summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-09-13 16:04:18 -0400
committerCary Clark <cary@android.com>2010-09-13 16:08:48 -0400
commit205a7cfa91854de791995f40278e8c19491f6d99 (patch)
tree8c824b3410d6beceef26cf57fb84a9a640542824 /WebKit
parent43df208144c6a77abc560712195027cbc13ce9de (diff)
downloadexternal_webkit-205a7cfa91854de791995f40278e8c19491f6d99.zip
external_webkit-205a7cfa91854de791995f40278e8c19491f6d99.tar.gz
external_webkit-205a7cfa91854de791995f40278e8c19491f6d99.tar.bz2
clip img elements the same as text
The nav cache builds the cursor ring by collecting the bounds of the text and images contained by the clickable node. The clip described by the parent node is available when the bounds are collected. The current code clips the text. Generalize this to clip the images also. Also, print whether the node is transparent in the node dumper. Change-Id: I44d6cbacb95211f191cf11b6abd5273e0712930f http://b/2463829
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 3453d20..8adc648 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -473,9 +473,11 @@ void CacheBuilder::Debug::groups() {
RenderStyle* style = renderer->style();
snprintf(scratch, sizeof(scratch), "// renderStyle:"
" visibility=%s hasBackGround=%d"
- " tapHighlightColor().alpha()=0x%02x",
+ " tapHighlightColor().alpha()=0x%02x"
+ " isTransparent()=%s",
style->visibility() == HIDDEN ? "HIDDEN" : "VISIBLE",
- renderer->hasBackground(), style->tapHighlightColor().alpha());
+ renderer->hasBackground(), style->tapHighlightColor().alpha(),
+ renderer->isTransparent() ? "true" : "false");
newLine();
print(scratch);
RenderBlock* renderBlock = static_cast<RenderBlock*>(renderer);
@@ -3023,18 +3025,18 @@ bool CacheBuilder::ConstructPartRects(Node* node, const IntRect& bounds,
EVisibility vis = renderer->style()->visibility();
if (vis == HIDDEN)
continue;
+ bool hasClip = renderer->hasOverflowClip();
+ size_t clipIndex = clipTracker.size();
+ IntRect clipBounds = IntRect(0, 0, INT_MAX, INT_MAX);
+ if (hasClip || --clipIndex > 0) {
+ clipBounds = hasClip ? renderer->absoluteBoundingBoxRect() :
+ clipTracker.at(clipIndex).mBounds; // x, y fixup done by ConstructTextRect
+ }
if (test->isTextNode()) {
RenderText* renderText = (RenderText*) renderer;
InlineTextBox *textBox = renderText->firstTextBox();
if (textBox == NULL)
continue;
- bool hasClip = renderer->hasOverflowClip();
- size_t clipIndex = clipTracker.size();
- IntRect clipBounds = IntRect(0, 0, INT_MAX, INT_MAX);
- if (hasClip || --clipIndex > 0) {
- clipBounds = hasClip ? renderer->absoluteBoundingBoxRect() :
- clipTracker.at(clipIndex).mBounds; // x, y fixup done by ConstructTextRect
- }
if (ConstructTextRect((Text*) test, textBox, 0, INT_MAX,
x, y, focusBounds, clipBounds, result) == false) {
return false;
@@ -3043,6 +3045,7 @@ bool CacheBuilder::ConstructPartRects(Node* node, const IntRect& bounds,
}
if (test->hasTagName(HTMLNames::imgTag)) {
IntRect bounds = test->getRect();
+ bounds.intersect(clipBounds);
if (AddPartRect(bounds, x, y, result, focusBounds) == false)
return false;
continue;