Changeset 70816 in webkit


Ignore:
Timestamp:
Oct 28, 2010 3:12:29 PM (14 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=48568

Reviewed by James Robinson.

WebCore:

Backgrounds don't work right with vertical RenderInlines. Make background painting
do the right thing for vertical strips.

Added fast/blockflow/background-* tests

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::paintFillLayer):

LayoutTests:

Backgrounds don't work right with vertical RenderInlines. Make background painting
do the right thing for vertical strips.

  • fast/blockflow/background-horizontal-bt.html: Added.
  • fast/blockflow/background-vertical-lr.html: Added.
  • fast/blockflow/background-vertical-rl.html: Added.
  • platform/mac/fast/blockflow/background-horizontal-bt-expected.checksum: Added.
  • platform/mac/fast/blockflow/background-horizontal-bt-expected.png: Added.
  • platform/mac/fast/blockflow/background-horizontal-bt-expected.txt: Added.
  • platform/mac/fast/blockflow/background-vertical-lr-expected.checksum: Added.
  • platform/mac/fast/blockflow/background-vertical-lr-expected.png: Added.
  • platform/mac/fast/blockflow/background-vertical-lr-expected.txt: Added.
  • platform/mac/fast/blockflow/background-vertical-rl-expected.checksum: Added.
  • platform/mac/fast/blockflow/background-vertical-rl-expected.png: Added.
  • platform/mac/fast/blockflow/background-vertical-rl-expected.txt: Added.
Location:
trunk
Files:
12 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70814 r70816  
     12010-10-28  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by James Robinson.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48568
     6
     7        Backgrounds don't work right with vertical RenderInlines. Make background painting
     8        do the right thing for vertical strips.
     9       
     10        * fast/blockflow/background-horizontal-bt.html: Added.
     11        * fast/blockflow/background-vertical-lr.html: Added.
     12        * fast/blockflow/background-vertical-rl.html: Added.
     13        * platform/mac/fast/blockflow/background-horizontal-bt-expected.checksum: Added.
     14        * platform/mac/fast/blockflow/background-horizontal-bt-expected.png: Added.
     15        * platform/mac/fast/blockflow/background-horizontal-bt-expected.txt: Added.
     16        * platform/mac/fast/blockflow/background-vertical-lr-expected.checksum: Added.
     17        * platform/mac/fast/blockflow/background-vertical-lr-expected.png: Added.
     18        * platform/mac/fast/blockflow/background-vertical-lr-expected.txt: Added.
     19        * platform/mac/fast/blockflow/background-vertical-rl-expected.checksum: Added.
     20        * platform/mac/fast/blockflow/background-vertical-rl-expected.png: Added.
     21        * platform/mac/fast/blockflow/background-vertical-rl-expected.txt: Added.
     22
    1232010-10-28  Eric Carlson  <eric.carlson@apple.com>
    224
  • trunk/WebCore/ChangeLog

    r70814 r70816  
     12010-10-28  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by James Robinson.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48568
     6
     7        Backgrounds don't work right with vertical RenderInlines. Make background painting
     8        do the right thing for vertical strips.
     9
     10        Added fast/blockflow/background-* tests
     11
     12        * rendering/InlineFlowBox.cpp:
     13        (WebCore::InlineFlowBox::paintFillLayer):
     14
    1152010-10-28  Eric Carlson  <eric.carlson@apple.com>
    216
  • trunk/WebCore/rendering/InlineFlowBox.cpp

    r70813 r70816  
    756756    else {
    757757        // We have a fill image that spans multiple lines.
    758         // We need to adjust _tx and _ty by the width of all previous lines.
     758        // We need to adjust tx and ty by the width of all previous lines.
    759759        // Think of background painting on inlines as though you had one long line, a single continuous
    760760        // strip.  Even though that strip has been broken up across multiple lines, you still paint it
     
    763763        // FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
    764764        // but it isn't even clear how this should work at all.
    765         int xOffsetOnLine = 0;
     765        int logicalOffsetOnLine = 0;
    766766        for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
    767             xOffsetOnLine += curr->logicalWidth();
    768         int startX = tx - xOffsetOnLine;
    769         int totalWidth = xOffsetOnLine;
     767            logicalOffsetOnLine += curr->logicalWidth();
     768        int totalLogicalWidth = logicalOffsetOnLine;
    770769        for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
    771             totalWidth += curr->logicalWidth();
     770            totalLogicalWidth += curr->logicalWidth();
     771        int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
     772        int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
     773        int stripWidth = isVertical() ? width() : totalLogicalWidth;
     774        int stripHeight = isVertical() ? totalLogicalWidth : height();
    772775        paintInfo.context->save();
    773         paintInfo.context->clip(IntRect(tx, ty, logicalWidth(), logicalHeight()));
    774         boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, startX, ty, totalWidth, h, this, op);
     776        paintInfo.context->clip(IntRect(tx, ty, width(), height()));
     777        boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, stripX, stripY, stripWidth, stripHeight, this, op);
    775778        paintInfo.context->restore();
    776779    }
Note: See TracChangeset for help on using the changeset viewer.