Changeset 70813 in webkit


Ignore:
Timestamp:
Oct 28, 2010 2:44:40 PM (13 years ago)
Author:
hyatt@apple.com
Message:

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

Reviewed by Beth Dakin.

Border images don't work right with vertical RenderInlines. Make border/mask/background painting
do the right thing for vertical strips.

WebCore:

Added fast/blockflow/border-image-* tests.

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):

LayoutTests:

  • fast/blockflow/border-image-horizontal-bt.html: Added.
  • fast/blockflow/border-image-vertical-lr.html: Added.
  • fast/blockflow/border-image-vertical-rl.html: Added.
Location:
trunk
Files:
12 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70810 r70813  
     12010-10-28  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Beth Dakin.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48443
     6       
     7        Border images don't work right with vertical RenderInlines. Make border/mask/background painting
     8        do the right thing for vertical strips.
     9
     10        * fast/blockflow/border-image-horizontal-bt.html: Added.
     11        * fast/blockflow/border-image-vertical-lr.html: Added.
     12        * fast/blockflow/border-image-vertical-rl.html: Added.
     13
    1142010-10-28  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/WebCore/ChangeLog

    r70812 r70813  
     12010-10-28  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Beth Dakin.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48443
     6       
     7        Border images don't work right with vertical RenderInlines. Make border/mask/background painting
     8        do the right thing for vertical strips.
     9
     10        Added fast/blockflow/border-image-* tests.
     11
     12        * rendering/InlineFlowBox.cpp:
     13        (WebCore::InlineFlowBox::paintBoxDecorations):
     14        (WebCore::InlineFlowBox::paintMask):
     15
    1162010-10-28  Patrick Gansterer  <paroga@webkit.org>
    217
  • trunk/WebCore/rendering/InlineFlowBox.cpp

    r70482 r70813  
    845845            else {
    846846                // We have a border image that spans multiple lines.
    847                 // We need to adjust _tx and _ty by the width of all previous lines.
     847                // We need to adjust tx and ty by the width of all previous lines.
    848848                // Think of border image painting on inlines as though you had one long line, a single continuous
    849849                // strip.  Even though that strip has been broken up across multiple lines, you still paint it
     
    852852                // FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
    853853                // but it isn't even clear how this should work at all.
    854                 int xOffsetOnLine = 0;
     854                int logicalOffsetOnLine = 0;
    855855                for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
    856                     xOffsetOnLine += curr->logicalWidth();
    857                 int startX = tx - xOffsetOnLine;
    858                 int totalWidth = xOffsetOnLine;
     856                    logicalOffsetOnLine += curr->logicalWidth();
     857                int totalLogicalWidth = logicalOffsetOnLine;
    859858                for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
    860                     totalWidth += curr->logicalWidth();
     859                    totalLogicalWidth += curr->logicalWidth();
     860                int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
     861                int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
     862                int stripWidth = isVertical() ? w : totalLogicalWidth;
     863                int stripHeight = isVertical() ? totalLogicalWidth : h;
    861864                context->save();
    862865                context->clip(IntRect(tx, ty, w, h));
    863                 boxModelObject()->paintBorder(context, startX, ty, totalWidth, h, renderer()->style());
     866                boxModelObject()->paintBorder(context, stripX, stripY, stripWidth, stripHeight, renderer()->style());
    864867                context->restore();
    865868            }
     
    927930        // We have a mask image that spans multiple lines.
    928931        // We need to adjust _tx and _ty by the width of all previous lines.
    929         int xOffsetOnLine = 0;
     932        int logicalOffsetOnLine = 0;
    930933        for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
    931             xOffsetOnLine += curr->logicalWidth();
    932         int startX = tx - xOffsetOnLine;
    933         int totalWidth = xOffsetOnLine;
     934            logicalOffsetOnLine += curr->logicalWidth();
     935        int totalLogicalWidth = logicalOffsetOnLine;
    934936        for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
    935             totalWidth += curr->logicalWidth();
     937            totalLogicalWidth += curr->logicalWidth();
     938        int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
     939        int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
     940        int stripWidth = isVertical() ? w : totalLogicalWidth;
     941        int stripHeight = isVertical() ? totalLogicalWidth : h;
    936942        paintInfo.context->save();
    937943        paintInfo.context->clip(IntRect(tx, ty, w, h));
    938         boxModelObject()->paintNinePieceImage(paintInfo.context, startX, ty, totalWidth, h, renderer()->style(), maskNinePieceImage, compositeOp);
     944        boxModelObject()->paintNinePieceImage(paintInfo.context, stripX, stripY, stripWidth, stripHeight, renderer()->style(), maskNinePieceImage, compositeOp);
    939945        paintInfo.context->restore();
    940946    }
Note: See TracChangeset for help on using the changeset viewer.