[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

hyatt at apple.com hyatt at apple.com
Thu Apr 8 01:03:45 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f24da9844904e5476ff9860525ffcf8bff35cec9
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 13 21:23:38 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=32495
    
    Reviewed by Dan Bernstein.
    
    font-size:small with background-color causes text to get clipped.  Make sure to only paint within the lineTop/lineBottom of
    a line for quirky inline flow boxes that didn't contribute to the overall height of the line.
    
    Added fast/backgrounds/quirks-mode-line-boxes-backgrounds.html
    
    * rendering/InlineFlowBox.cpp:
    (WebCore::InlineFlowBox::computeVerticalOverflow):
    (WebCore::InlineFlowBox::paintBoxDecorations):
    (WebCore::InlineFlowBox::paintMask):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds.html b/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds.html
new file mode 100644
index 0000000..0867e14
--- /dev/null
+++ b/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds.html
@@ -0,0 +1,12 @@
+The following two lines should be visible without the white background clipping any of the text:
+
+<p>
+<span style="background-color: white; font-size: 20px;">
+<span style="font-size: small; ">FOOBARBAZ<br>BAZBARFOO</span></span>
+</p>
+
+The background below should be 10x10 and snugly fit the image:
+
+<p>
+<span style="background-color: red; font-size: 40px;"><img style="width: 10px; height: 10px;"></span>
+</p>
diff --git a/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.checksum b/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.checksum
new file mode 100644
index 0000000..8492a8b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.checksum
@@ -0,0 +1 @@
+a68b2cedb5678c8e6145a447a77ffd62
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.png b/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.png
new file mode 100644
index 0000000..83955f0
Binary files /dev/null and b/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt b/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt
new file mode 100644
index 0000000..fe76dcf
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock (anonymous) at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 607x18
+          text run at (0,0) width 607: "The following two lines should be visible without the white background clipping any of the text:"
+      RenderBlock {P} at (0,34) size 784x30
+        RenderInline {SPAN} at (0,0) size 78x38 [bgcolor=#FFFFFF]
+          RenderText {#text} at (0,0) size 0x0
+          RenderInline {SPAN} at (0,0) size 78x30
+            RenderText {#text} at (0,0) size 78x15
+              text run at (0,0) width 78: "FOOBARBAZ"
+            RenderBR {BR} at (78,12) size 0x0
+            RenderText {#text} at (0,15) size 78x15
+              text run at (0,15) width 78: "BAZBARFOO"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock (anonymous) at (0,80) size 784x18
+        RenderText {#text} at (0,0) size 415x18
+          text run at (0,0) width 415: "The background below should be 10x10 and snugly fit the image:"
+      RenderBlock {P} at (0,114) size 784x10
+        RenderInline {SPAN} at (0,0) size 10x46 [bgcolor=#FF0000]
+          RenderImage {IMG} at (0,0) size 10x10
+        RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c4db241..5dfd82f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-13  Dave Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32495
+
+        font-size:small with background-color causes text to get clipped.  Make sure to only paint within the lineTop/lineBottom of
+        a line for quirky inline flow boxes that didn't contribute to the overall height of the line. 
+        
+        Added fast/backgrounds/quirks-mode-line-boxes-backgrounds.html
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::computeVerticalOverflow):
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+        (WebCore::InlineFlowBox::paintMask):
+
 2010-01-13  Dumitru Daniliuc  <dumi at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index 2bd1683..b42ea33 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -532,9 +532,6 @@ void InlineFlowBox::computeVerticalOverflow(int lineTop, int lineBottom, bool st
 
     // Any spillage outside of the line top and bottom is not considered overflow.  We just ignore this, since it only happens
     // from the "your ascent/descent don't affect the line" quirk.
-    // FIXME: Technically this means there can be repaint errors in the case where a line box has a shadow or background that spills
-    // outside of the block. We should consider making any line box that has anything to render just stop respecting the quirk or making
-    // boxes that render something set visual overflow.
     int topOverflow = max(y(), lineTop);
     int bottomOverflow = min(y() + boxHeight, lineBottom);
     
@@ -735,13 +732,24 @@ void InlineFlowBox::paintBoxDecorations(RenderObject::PaintInfo& paintInfo, int
     if (!renderer()->shouldPaintWithinRoot(paintInfo) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
         return;
 
-    // Move x/y to our coordinates.
-    tx += m_x;
-    ty += m_y;
-    
+    int x = m_x;
+    int y = m_y;
     int w = width();
     int h = height();
 
+    // Constrain our background/border painting to the line top and bottom if necessary.
+    bool strictMode = renderer()->document()->inStrictMode();
+    if (!hasTextChildren() && !strictMode) {
+        RootInlineBox* rootBox = root();
+        int bottom = min(rootBox->lineBottom(), y + h);
+        y = max(rootBox->lineTop(), y);
+        h = bottom - y;
+    }
+    
+    // Move x/y to our coordinates.
+    tx += x;
+    ty += y;
+    
     GraphicsContext* context = paintInfo.context;
     
     // You can use p::first-line to specify a background. If so, the root line boxes for
@@ -800,13 +808,24 @@ void InlineFlowBox::paintMask(RenderObject::PaintInfo& paintInfo, int tx, int ty
     if (!renderer()->shouldPaintWithinRoot(paintInfo) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
         return;
 
-    // Move x/y to our coordinates.
-    tx += m_x;
-    ty += m_y;
-    
+    int x = m_x;
+    int y = m_y;
     int w = width();
     int h = height();
 
+    // Constrain our background/border painting to the line top and bottom if necessary.
+    bool strictMode = renderer()->document()->inStrictMode();
+    if (!hasTextChildren() && !strictMode) {
+        RootInlineBox* rootBox = root();
+        int bottom = min(rootBox->lineBottom(), y + h);
+        y = max(rootBox->lineTop(), y);
+        h = bottom - y;
+    }
+    
+    // Move x/y to our coordinates.
+    tx += x;
+    ty += y;
+
     const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
     StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image();
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list