Changeset 196222 in webkit


Ignore:
Timestamp:
Feb 6, 2016 3:07:54 PM (8 years ago)
Author:
Alan Bujtas
Message:

Outline should contribute to visual overflow.
https://bugs.webkit.org/show_bug.cgi?id=153299

This patch eliminates the special outline handling (RenderView::setMaximalOutlineSize).
Now that outline is part of visual overflow, we don't have to inflate the layers to accomodate
outline borders.
This patch fixes several focusring related repaint issues. However when both the outline: auto
and the descendant renderer are composited, we still don't paint properly in certain cases. -not a regression.
(Also when parent renderer has overflow: hidden repaint does not take outline into account. -regression.)
It changes column behavior (see TestExpectations) since outline behaves now like any other visual overflow properties.

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/repaint/focus-ring-repaint.html

fast/repaint/focus-ring-repaint-with-negative-offset.html

  • css/html.css: resetting to old behavior.

(:focus):
(input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus):

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::addOutlineVisualOverflow):
(WebCore::InlineFlowBox::computeOverflow):
(WebCore::InlineFlowBox::paint): Deleted.

  • rendering/InlineFlowBox.h:
  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeOverflow):
(WebCore::RenderBlock::outlineStyleForRepaint):
(WebCore::RenderBlock::paint): Deleted.

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::layoutBlock): Deleted.
(WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren): Deleted.

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::addOverflowFromInlineChildren):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::addVisualEffectOverflow):
(WebCore::RenderBox::applyVisualEffectOverflow):
(WebCore::RenderBox::clippedOverflowRectForRepaint): Deleted.

  • rendering/RenderBoxModelObject.h:
  • rendering/RenderDetailsMarker.cpp:

(WebCore::RenderDetailsMarker::paint): Deleted.

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::repaintAfterLayoutIfNeeded):
(WebCore::RenderElement::issueRepaintForOutlineAuto):
(WebCore::RenderElement::updateOutlineAutoAncestor):
(WebCore::RenderElement::computeMaxOutlineSize): Deleted.
(WebCore::RenderElement::styleWillChange): Deleted.

  • rendering/RenderElement.h:

(WebCore::RenderElement::hasContinuation):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::paintOutlineForLine): Deleted.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::calculateClipRects):

  • rendering/RenderLineBoxList.cpp:

(WebCore::RenderLineBoxList::anyLineIntersectsRect):
(WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
(WebCore::RenderLineBoxList::paint):
(WebCore::isOutlinePhase): Deleted.

  • rendering/RenderLineBoxList.h:
  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::computePreferredLogicalWidths):

  • rendering/RenderListMarker.cpp:

(WebCore::RenderListMarker::paint): Deleted.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded): The renderer with outline: auto is responsible for
painting focusring around the descendants. If we issued repaint only on the descendant when it changes,
the focusring would not refresh properly. We have to find the ancestor with outline: auto, inflate the repaint rect and
issue the repaint on the ancestor if we crossed repaint container.

(WebCore::RenderObject::repaintUsingContainer):
(WebCore::RenderObject::adjustRectForOutlineAndShadow):
(WebCore::RenderObject::setHasOutlineAutoAncestor):
(WebCore::RenderObject::adjustRectWithMaximumOutline): Deleted.

  • rendering/RenderObject.h: We mark the descendants of outline: auto so that

when a child renderer changes we can propagate the repaint to the ancestor with outline.

(WebCore::RenderObject::hasOutlineAutoAncestor):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):

  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::overflowRectForFlowThreadPortion):

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::shouldPaint): Deleted.
(WebCore::RenderReplaced::clippedOverflowRectForRepaint): Deleted.

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::paint): Deleted.

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::clippedOverflowRectForRepaint): Deleted.
(WebCore::RenderTableCell::paintCollapsedBorders): Deleted.

  • rendering/RenderTableRow.cpp:

(WebCore::RenderTableRow::layout):
(WebCore::RenderTableRow::clippedOverflowRectForRepaint): Deleted.

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::computeOverflowFromCells): Deleted.
(WebCore::RenderTableSection::paintObject): Deleted.

  • rendering/RenderTheme.h:

(WebCore::RenderTheme::platformFocusRingWidth):

  • rendering/RenderView.cpp:

(WebCore::RenderView::setMaximalOutlineSize): Deleted.

  • rendering/RenderView.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeAffectsVisualOverflow):
(WebCore::RenderStyle::outlineWidth):

  • rendering/style/RenderStyle.h:

LayoutTests:

  • fast/repaint/focus-ring-repaint-expected.txt: Added.
  • fast/repaint/focus-ring-repaint.html: Added.
  • fast/repaint/focus-ring-repaint-expected-with-negative-offset.txt: Added.
  • fast/repaint/focus-ring-repaint-with-negative-offset.html: Added.
  • TestExpectations:
  • platform/mac/TestExpectations:
  • platform/mac/compositing/geometry/ancestor-overflow-change-expected.txt:
  • platform/mac/compositing/geometry/composited-in-columns-expected.txt:
  • platform/mac/compositing/layer-creation/overlap-animation-container-expected.txt:
  • platform/mac/compositing/layer-creation/stacking-context-overlap-nested-expected.txt:
  • platform/mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt:
  • platform/mac/fast/clip/outline-overflowClip-expected.txt:
  • platform/mac/fast/inline/continuation-outlines-with-layers-expected.txt:
  • platform/mac/fast/repaint/4776765-expected.txt: Added.
  • platform/mac/fast/repaint/focus-ring-expected.txt: Added.
  • platform/mac/fast/repaint/layer-outline-expected.txt:
  • platform/mac/fast/repaint/layer-outline-horizontal-expected.txt:
  • platform/mac/svg/custom/focus-ring-expected.txt:
Location:
trunk
Files:
4 added
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r196221 r196222  
     12016-02-06  Zalan Bujtas  <zalan@apple.com>
     2
     3        Outline should contribute to visual overflow.
     4        https://bugs.webkit.org/show_bug.cgi?id=153299
     5
     6        This patch eliminates the special outline handling (RenderView::setMaximalOutlineSize).
     7        Now that outline is part of visual overflow, we don't have to inflate the layers to accomodate
     8        outline borders.
     9        This patch fixes several focusring related repaint issues. However when both the outline: auto
     10        and the descendant renderer are composited, we still don't paint properly in certain cases. -not a regression.
     11        (Also when parent renderer has overflow: hidden repaint does not take outline into account. -regression.)
     12        It changes column behavior (see TestExpectations) since outline behaves now like any other visual overflow properties.
     13
     14        Reviewed by David Hyatt.
     15
     16        * fast/repaint/focus-ring-repaint-expected.txt: Added.
     17        * fast/repaint/focus-ring-repaint.html: Added.
     18        * fast/repaint/focus-ring-repaint-expected-with-negative-offset.txt: Added.
     19        * fast/repaint/focus-ring-repaint-with-negative-offset.html: Added.
     20        * TestExpectations:
     21        * platform/mac/TestExpectations:
     22        * platform/mac/compositing/geometry/ancestor-overflow-change-expected.txt:
     23        * platform/mac/compositing/geometry/composited-in-columns-expected.txt:
     24        * platform/mac/compositing/layer-creation/overlap-animation-container-expected.txt:
     25        * platform/mac/compositing/layer-creation/stacking-context-overlap-nested-expected.txt:
     26        * platform/mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt:
     27        * platform/mac/fast/clip/outline-overflowClip-expected.txt:
     28        * platform/mac/fast/inline/continuation-outlines-with-layers-expected.txt:
     29        * platform/mac/fast/repaint/4776765-expected.txt: Added.
     30        * platform/mac/fast/repaint/focus-ring-expected.txt: Added.
     31        * platform/mac/fast/repaint/layer-outline-expected.txt:
     32        * platform/mac/fast/repaint/layer-outline-horizontal-expected.txt:
     33        * platform/mac/svg/custom/focus-ring-expected.txt:
     34
    1352016-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
    236
  • trunk/LayoutTests/TestExpectations

    r196091 r196222  
    852852loader/stateobjects/replacestate-size-iframe.html [ Slow ]
    853853loader/stateobjects/replacestate-size.html [ Slow ]
     854
     855# outline: auto -focusring.
     856imported/blink/fast/multicol/outlines-at-column-boundaries.html [ ImageOnlyFailure ]
     857fast/multicol/multicol-with-child-renderLayer-for-input.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/compositing/layer-creation/stacking-context-overlap-nested-expected.txt

    r168244 r196222  
    2020        )
    2121        (GraphicsLayer
    22           (position 65.00 65.00)
    23           (bounds 76.00 76.00)
     22          (position 75.00 75.00)
     23          (bounds 56.00 56.00)
     24          (contentsOpaque 1)
    2425        )
    2526      )
  • trunk/LayoutTests/fast/repaint/4776765-expected.txt

    r189176 r196222  
    33
    44(repaint rects
    5   (rect 5 41 790 6)
    6   (rect -3 -3 3 606)
    7   (rect 800 -3 3 606)
    8   (rect -3 -3 806 3)
    9   (rect -3 600 806 3)
    10   (rect -3 -3 3 606)
    11   (rect 800 -3 3 606)
    12   (rect -3 -3 806 3)
    13   (rect -3 600 806 3)
    14   (rect 5 41 790 6)
    15   (rect 5 41 790 24)
    16   (rect 5 47 790 18)
    17   (rect 5 44 790 3)
     5  (rect 1 37 798 32)
     6  (rect 8 44 784 18)
     7  (rect 1 51 798 18)
     8  (rect 1 44 798 7)
     9  (rect 1 19 15 32)
    1810  (rect 8 26 1 18)
     11  (rect 1 37 15 32)
    1912  (rect 8 44 1 18)
    2013)
  • trunk/LayoutTests/fast/repaint/focus-ring-expected.txt

    r149088 r196222  
    55    RenderBody {BODY} at (8,20) size 784x560
    66      RenderBlock {DIV} at (20,0) size 100x100 [bgcolor=#FFFFE0]
    7 layer at (28,148) size 100x100 backgroundClip at (28,148) size 50x50 clip at (18,138) size 60x60 outlineClip at (18,138) size 60x60
     7layer at (28,148) size 100x100 backgroundClip at (18,138) size 60x60 clip at (18,138) size 60x60 outlineClip at (18,138) size 60x60
    88  RenderBlock (positioned) {DIV} at (28,148) size 100x100 [bgcolor=#FFFFE0]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r196196 r196222  
    13231323# This test is already run with run-jsc-stress-tests
    13241324webkit.org/b/153879 js/basic-set.html [ Skip ]
     1325
     1326# outline: auto -focusring.
     1327accessibility/mac/selection-element-tabbing-to-link.html [ Pass Failure ]
     1328accessibility/mac/selection-notification-focus-change.html [ Pass Failure ]
  • trunk/LayoutTests/platform/mac/compositing/geometry/ancestor-overflow-change-expected.txt

    r174585 r196222  
    88      (children 1
    99        (GraphicsLayer
    10           (position 6.00 6.00)
    11           (bounds 104.00 104.00)
     10          (position 8.00 8.00)
     11          (bounds 100.00 100.00)
     12          (contentsOpaque 1)
    1213          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    1314        )
  • trunk/LayoutTests/platform/mac/compositing/geometry/composited-in-columns-expected.txt

    r174585 r196222  
    1313          (children 1
    1414            (GraphicsLayer
    15               (bounds 60.00 60.00)
     15              (position 5.00 5.00)
     16              (bounds 50.00 50.00)
     17              (contentsOpaque 1)
    1618            )
    1719          )
     
    2325          (children 1
    2426            (GraphicsLayer
    25               (bounds 60.00 60.00)
     27              (position 5.00 5.00)
     28              (bounds 50.00 50.00)
     29              (contentsOpaque 1)
    2630            )
    2731          )
  • trunk/LayoutTests/platform/mac/compositing/layer-creation/overlap-animation-container-expected.txt

    r183950 r196222  
    99      (children 3
    1010        (GraphicsLayer
    11           (position 17.00 119.00)
    12           (bounds 102.00 102.00)
     11          (position 18.00 120.00)
     12          (bounds 100.00 100.00)
     13          (contentsOpaque 1)
    1314          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 -110.00 0.00 1.00])
    1415        )
    1516        (GraphicsLayer
    16           (position 46.00 229.00)
    17           (bounds 146.00 454.00)
     17          (position 46.00 230.00)
     18          (bounds 146.00 452.00)
    1819          (drawsContent 1)
    1920          (children 1
    2021            (GraphicsLayer
    21               (position 22.00 11.00)
    22               (bounds 102.00 102.00)
     22              (position 23.00 11.00)
     23              (bounds 100.00 100.00)
     24              (contentsOpaque 1)
    2325              (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 -1.00 1.00])
    2426            )
     
    2628        )
    2729        (GraphicsLayer
    28           (position 17.00 691.00)
    29           (bounds 102.00 102.00)
     30          (position 18.00 692.00)
     31          (bounds 100.00 100.00)
     32          (contentsOpaque 1)
    3033        )
    3134      )
     
    4447      (children 3
    4548        (GraphicsLayer
    46           (position 17.00 119.00)
    47           (bounds 102.00 102.00)
     49          (position 18.00 120.00)
     50          (bounds 100.00 100.00)
     51          (contentsOpaque 1)
    4852          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 -110.00 0.00 1.00])
    4953        )
    5054        (GraphicsLayer
    51           (position 57.00 229.00)
    52           (bounds 124.00 454.00)
     55          (position 58.00 230.00)
     56          (bounds 122.00 452.00)
     57          (contentsOpaque 1)
    5358          (drawsContent 1)
    5459          (children 4
    5560            (GraphicsLayer
    5661              (position 11.00 11.00)
    57               (bounds 102.00 102.00)
     62              (bounds 100.00 100.00)
     63              (contentsOpaque 1)
    5864              (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 -1.00 1.00])
    5965            )
    6066            (GraphicsLayer
    61               (position 11.00 121.00)
     67              (position 10.00 120.00)
    6268              (bounds 102.00 102.00)
    6369              (drawsContent 1)
     
    6571            )
    6672            (GraphicsLayer
    67               (position 11.00 231.00)
     73              (position 10.00 230.00)
    6874              (bounds 102.00 102.00)
    6975              (drawsContent 1)
     
    7177            )
    7278            (GraphicsLayer
    73               (position 11.00 341.00)
     79              (position 10.00 340.00)
    7480              (bounds 102.00 102.00)
    7581              (drawsContent 1)
     
    7884        )
    7985        (GraphicsLayer
    80           (position 17.00 691.00)
    81           (bounds 102.00 102.00)
     86          (position 18.00 692.00)
     87          (bounds 100.00 100.00)
     88          (contentsOpaque 1)
    8289        )
    8390      )
  • trunk/LayoutTests/platform/mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt

    r168310 r196222  
    1313      (children 3
    1414        (GraphicsLayer
    15           (position 14.00 6.00)
     15          (position 18.00 10.00)
    1616          (anchor 0.50 0.50)
    17           (bounds 757.00 152.00)
     17          (bounds 749.00 144.00)
    1818          (children 1
    1919            (GraphicsLayer
    2020              (position 20.00 20.00)
    21               (bounds 108.00 108.00)
     21              (bounds 100.00 100.00)
    2222              (contentsVisible 0)
    2323            )
     
    3131          (children 1
    3232            (GraphicsLayer
    33               (position 20.00 20.00)
    34               (bounds 108.00 108.00)
     33              (position 24.00 24.00)
     34              (bounds 100.00 100.00)
    3535              (contentsVisible 0)
    3636            )
     
    4444          (children 1
    4545            (GraphicsLayer
    46               (position 20.00 20.00)
    47               (bounds 108.00 108.00)
     46              (position 24.00 24.00)
     47              (bounds 100.00 100.00)
    4848            )
    4949          )
     
    6464      (children 3
    6565        (GraphicsLayer
    66           (position 14.00 6.00)
     66          (position 18.00 10.00)
    6767          (anchor 0.50 0.50)
    68           (bounds 757.00 152.00)
     68          (bounds 749.00 144.00)
    6969          (children 1
    7070            (GraphicsLayer
    7171              (position 20.00 20.00)
    72               (bounds 108.00 108.00)
     72              (bounds 100.00 100.00)
    7373            )
    7474          )
     
    8181          (children 1
    8282            (GraphicsLayer
    83               (position 20.00 20.00)
    84               (bounds 108.00 108.00)
     83              (position 24.00 24.00)
     84              (bounds 100.00 100.00)
    8585              (contentsVisible 0)
    8686            )
     
    9494          (children 1
    9595            (GraphicsLayer
    96               (position 20.00 20.00)
    97               (bounds 108.00 108.00)
     96              (position 24.00 24.00)
     97              (bounds 100.00 100.00)
    9898            )
    9999          )
     
    114114      (children 3
    115115        (GraphicsLayer
    116           (position 14.00 6.00)
     116          (position 18.00 10.00)
    117117          (anchor 0.50 0.50)
    118           (bounds 757.00 152.00)
     118          (bounds 749.00 144.00)
    119119          (children 1
    120120            (GraphicsLayer
    121121              (position 20.00 20.00)
    122               (bounds 108.00 108.00)
     122              (bounds 100.00 100.00)
    123123            )
    124124          )
     
    131131          (children 1
    132132            (GraphicsLayer
    133               (position 20.00 20.00)
    134               (bounds 108.00 108.00)
     133              (position 24.00 24.00)
     134              (bounds 100.00 100.00)
    135135            )
    136136          )
     
    143143          (children 1
    144144            (GraphicsLayer
    145               (position 20.00 20.00)
    146               (bounds 108.00 108.00)
     145              (position 24.00 24.00)
     146              (bounds 100.00 100.00)
    147147            )
    148148          )
  • trunk/LayoutTests/platform/mac/fast/clip/outline-overflowClip-expected.txt

    r177774 r196222  
    1515      text run at (2,2) width 102: "text in outer div"
    1616    RenderText {#text} at (0,0) size 0x0
    17 layer at (60,64) size 108x24 backgroundClip at (83,64) size 85x24 clip at (83,67) size 82x18 outlineClip at (83,44) size 229x204 scrollWidth 103
     17layer at (60,64) size 108x24 backgroundClip at (83,61) size 88x30 clip at (83,67) size 82x18 outlineClip at (83,44) size 229x204 scrollWidth 103
    1818  RenderBlock (positioned) {DIV} at (52,20) size 108x24 [bgcolor=#EEEEEE] [border: (3px solid #FF0000)]
    1919    RenderText {#text} at (3,3) size 102x18
  • trunk/LayoutTests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.txt

    r177774 r196222  
    3232    RenderText {#text} at (0,0) size 84x18
    3333      text run at (0,0) width 84: "Content after"
    34 layer at (8,164) size 0x0
    35   RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
    3634layer at (8,164) size 784x22
    3735  RenderBlock (anonymous) at (0,0) size 784x22
     
    5250      RenderText {#text} at (0,0) size 176x22
    5351        text run at (0,0) width 176: "But No Content After"
    54 layer at (8,316) size 0x0
    55   RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
    56 layer at (8,316) size 0x0
    57   RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
    5852layer at (8,316) size 784x22
    5953  RenderBlock (anonymous) at (0,0) size 784x22
     
    6155      RenderText {#text} at (0,0) size 214x22
    6256        text run at (0,0) width 214: "No content before or after."
    63 layer at (8,357) size 0x0
    64   RenderInline (relative positioned) {SPAN} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/repaint/layer-outline-expected.txt

    r177774 r196222  
    2222layer at (18,62) size 100x100
    2323  RenderBlock (positioned) {DIV} at (10,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    24 layer at (148,62) size 100x100 backgroundClip at (148,62) size 90x90 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x100
     24layer at (148,62) size 100x100 backgroundClip at (138,52) size 100x100 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x100
    2525  RenderBlock (positioned) {DIV} at (140,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
     26layer at (278,62) size 100x100 backgroundClip at (268,52) size 5x5 clip at (268,52) size 5x5 outlineClip at (268,52) size 5x5
     27  RenderBlock (positioned) {DIV} at (270,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    2628layer at (408,62) size 100x100
    2729  RenderBlock (positioned) {DIV} at (400,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    28 layer at (538,62) size 100x100 backgroundClip at (548,72) size 90x90 clip at (548,72) size 100x100 outlineClip at (548,72) size 100x100
     30layer at (538,62) size 100x100 backgroundClip at (548,72) size 100x100 clip at (548,72) size 100x100 outlineClip at (548,72) size 100x100
    2931  RenderBlock (positioned) {DIV} at (530,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
     32layer at (668,62) size 100x100 backgroundClip at (773,167) size 5x5 clip at (773,167) size 5x5 outlineClip at (773,167) size 5x5
     33  RenderBlock (positioned) {DIV} at (660,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    3034layer at (18,322) size 100x100
    3135  RenderBlock (relative positioned) {DIV} at (0,294) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
  • trunk/LayoutTests/platform/mac/fast/repaint/layer-outline-horizontal-expected.txt

    r177774 r196222  
    2222layer at (18,62) size 100x100
    2323  RenderBlock (positioned) {DIV} at (10,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    24 layer at (148,62) size 100x100 backgroundClip at (148,62) size 90x90 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x100
     24layer at (148,62) size 100x100 backgroundClip at (138,52) size 100x100 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x100
    2525  RenderBlock (positioned) {DIV} at (140,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
     26layer at (278,62) size 100x100 backgroundClip at (268,52) size 5x5 clip at (268,52) size 5x5 outlineClip at (268,52) size 5x5
     27  RenderBlock (positioned) {DIV} at (270,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    2628layer at (408,62) size 100x100
    2729  RenderBlock (positioned) {DIV} at (400,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    28 layer at (538,62) size 100x100 backgroundClip at (548,72) size 90x90 clip at (548,72) size 100x100 outlineClip at (548,72) size 100x100
     30layer at (538,62) size 100x100 backgroundClip at (548,72) size 100x100 clip at (548,72) size 100x100 outlineClip at (548,72) size 100x100
    2931  RenderBlock (positioned) {DIV} at (530,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
     32layer at (668,62) size 100x100 backgroundClip at (773,167) size 5x5 clip at (773,167) size 5x5 outlineClip at (773,167) size 5x5
     33  RenderBlock (positioned) {DIV} at (660,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
    3034layer at (18,322) size 100x100
    3135  RenderBlock (relative positioned) {DIV} at (0,294) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)]
  • trunk/Source/WebCore/ChangeLog

    r196217 r196222  
     12016-02-06  Zalan Bujtas  <zalan@apple.com>
     2
     3        Outline should contribute to visual overflow.
     4        https://bugs.webkit.org/show_bug.cgi?id=153299
     5
     6        This patch eliminates the special outline handling (RenderView::setMaximalOutlineSize).
     7        Now that outline is part of visual overflow, we don't have to inflate the layers to accomodate
     8        outline borders.
     9        This patch fixes several focusring related repaint issues. However when both the outline: auto
     10        and the descendant renderer are composited, we still don't paint properly in certain cases. -not a regression.
     11        (Also when parent renderer has overflow: hidden repaint does not take outline into account. -regression.)
     12        It changes column behavior (see TestExpectations) since outline behaves now like any other visual overflow properties.
     13
     14        Reviewed by David Hyatt.
     15
     16        Test: fast/repaint/focus-ring-repaint.html
     17              fast/repaint/focus-ring-repaint-with-negative-offset.html
     18
     19        * css/html.css: resetting to old behavior.
     20        (:focus):
     21        (input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus):
     22        * rendering/InlineFlowBox.cpp:
     23        (WebCore::InlineFlowBox::addToLine):
     24        (WebCore::InlineFlowBox::addOutlineVisualOverflow):
     25        (WebCore::InlineFlowBox::computeOverflow):
     26        (WebCore::InlineFlowBox::paint): Deleted.
     27        * rendering/InlineFlowBox.h:
     28        * rendering/RenderBlock.cpp:
     29        (WebCore::RenderBlock::computeOverflow):
     30        (WebCore::RenderBlock::outlineStyleForRepaint):
     31        (WebCore::RenderBlock::paint): Deleted.
     32        * rendering/RenderBlockFlow.cpp:
     33        (WebCore::RenderBlockFlow::layoutBlock): Deleted.
     34        (WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren): Deleted.
     35        * rendering/RenderBlockLineLayout.cpp:
     36        (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
     37        * rendering/RenderBox.cpp:
     38        (WebCore::RenderBox::addVisualEffectOverflow):
     39        (WebCore::RenderBox::applyVisualEffectOverflow):
     40        (WebCore::RenderBox::clippedOverflowRectForRepaint): Deleted.
     41        * rendering/RenderBoxModelObject.h:
     42        * rendering/RenderDetailsMarker.cpp:
     43        (WebCore::RenderDetailsMarker::paint): Deleted.
     44        * rendering/RenderElement.cpp:
     45        (WebCore::RenderElement::insertChildInternal):
     46        (WebCore::RenderElement::styleDidChange):
     47        (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
     48        (WebCore::RenderElement::issueRepaintForOutlineAuto):
     49        (WebCore::RenderElement::updateOutlineAutoAncestor):
     50        (WebCore::RenderElement::computeMaxOutlineSize): Deleted.
     51        (WebCore::RenderElement::styleWillChange): Deleted.
     52        * rendering/RenderElement.h:
     53        (WebCore::RenderElement::hasContinuation):
     54        * rendering/RenderInline.cpp:
     55        (WebCore::RenderInline::paintOutlineForLine): Deleted.
     56        * rendering/RenderLayer.cpp:
     57        (WebCore::RenderLayer::calculateClipRects):
     58        * rendering/RenderLineBoxList.cpp:
     59        (WebCore::RenderLineBoxList::anyLineIntersectsRect):
     60        (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
     61        (WebCore::RenderLineBoxList::paint):
     62        (WebCore::isOutlinePhase): Deleted.
     63        * rendering/RenderLineBoxList.h:
     64        * rendering/RenderListBox.cpp:
     65        (WebCore::RenderListBox::computePreferredLogicalWidths):
     66        * rendering/RenderListMarker.cpp:
     67        (WebCore::RenderListMarker::paint): Deleted.
     68        * rendering/RenderObject.cpp:
     69        (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded): The renderer with outline: auto is responsible for
     70        painting focusring around the descendants. If we issued repaint only on the descendant when it changes,
     71        the focusring would not refresh properly. We have to find the ancestor with outline: auto, inflate the repaint rect and
     72        issue the repaint on the ancestor if we crossed repaint container.
     73 
     74        (WebCore::RenderObject::repaintUsingContainer):
     75        (WebCore::RenderObject::adjustRectForOutlineAndShadow):
     76        (WebCore::RenderObject::setHasOutlineAutoAncestor):
     77        (WebCore::RenderObject::adjustRectWithMaximumOutline): Deleted.
     78       
     79        * rendering/RenderObject.h: We mark the descendants of outline: auto so that
     80        when a child renderer changes we can propagate the repaint to the ancestor with outline.
     81
     82        (WebCore::RenderObject::hasOutlineAutoAncestor):
     83        (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
     84        * rendering/RenderRegion.cpp:
     85        (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
     86        * rendering/RenderReplaced.cpp:
     87        (WebCore::RenderReplaced::shouldPaint): Deleted.
     88        (WebCore::RenderReplaced::clippedOverflowRectForRepaint): Deleted.
     89        * rendering/RenderTable.cpp:
     90        (WebCore::RenderTable::paint): Deleted.
     91        * rendering/RenderTableCell.cpp:
     92        (WebCore::RenderTableCell::clippedOverflowRectForRepaint): Deleted.
     93        (WebCore::RenderTableCell::paintCollapsedBorders): Deleted.
     94        * rendering/RenderTableRow.cpp:
     95        (WebCore::RenderTableRow::layout):
     96        (WebCore::RenderTableRow::clippedOverflowRectForRepaint): Deleted.
     97        * rendering/RenderTableSection.cpp:
     98        (WebCore::RenderTableSection::layoutRows):
     99        (WebCore::RenderTableSection::computeOverflowFromCells): Deleted.
     100        (WebCore::RenderTableSection::paintObject): Deleted.
     101        * rendering/RenderTheme.h:
     102        (WebCore::RenderTheme::platformFocusRingWidth):
     103        * rendering/RenderView.cpp:
     104        (WebCore::RenderView::setMaximalOutlineSize): Deleted.
     105        * rendering/RenderView.h:
     106        * rendering/style/RenderStyle.cpp:
     107        (WebCore::RenderStyle::changeAffectsVisualOverflow):
     108        (WebCore::RenderStyle::outlineWidth):
     109        * rendering/style/RenderStyle.h:
     110
    11112016-02-06  Andreas Kling  <akling@apple.com>
    2112
  • trunk/Source/WebCore/css/html.css

    r195685 r196222  
    11301130
    11311131:focus {
    1132     outline: auto;
     1132    outline: auto 5px -webkit-focus-ring-color;
    11331133}
    11341134
     
    11361136html:focus, body:focus, input[readonly]:focus, applet:focus, embed:focus, iframe:focus, object:focus {
    11371137    outline: none;
     1138}
     1139
     1140input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus {
     1141    outline-offset: -2px;
    11381142}
    11391143
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r191935 r196222  
    179179            || (is<RenderListMarker>(child->renderer()) && !downcast<RenderListMarker>(child->renderer()).isInside())
    180180            || childStyle.hasBorderImageOutsets()))
     181            child->clearKnownToHaveNoOverflow();
     182        else if (childStyle.hasOutlineInVisualOverflow())
    181183            child->clearKnownToHaveNoOverflow();
    182184       
     
    947949}
    948950
     951inline void InlineFlowBox::addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow)
     952{
     953    const auto& lineStyle = this->lineStyle();
     954    if (!lineStyle.hasOutlineInVisualOverflow())
     955        return;
     956    LayoutUnit outlineSize = lineStyle.outlineSize();
     957    LayoutUnit logicalTopVisualOverflow = std::min(LayoutUnit(logicalTop() - outlineSize), logicalVisualOverflow.y());
     958    LayoutUnit logicalBottomVisualOverflow = std::max(LayoutUnit(logicalBottom() + outlineSize), logicalVisualOverflow.maxY());
     959    LayoutUnit logicalLeftVisualOverflow = std::min(LayoutUnit(logicalLeft() - outlineSize), logicalVisualOverflow.x());
     960    LayoutUnit logicalRightVisualOverflow = std::max(LayoutUnit(logicalRight() + outlineSize), logicalVisualOverflow.maxX());
     961    logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow,
     962        logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow);
     963}
     964
    949965inline void InlineFlowBox::addReplacedChildOverflow(const InlineBox* inlineBox, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow)
    950966{
     
    9841000 
    9851001    addBoxShadowVisualOverflow(logicalVisualOverflow);
     1002    addOutlineVisualOverflow(logicalVisualOverflow);
    9861003    addBorderOutsetVisualOverflow(logicalVisualOverflow);
    9871004
     
    11471164
    11481165    LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom));
    1149     renderer().adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);
    11501166    flipForWritingMode(overflowRect);
    11511167    overflowRect.moveBy(paintOffset);
  • trunk/Source/WebCore/rendering/InlineFlowBox.h

    r189594 r196222  
    310310    void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow);
    311311    void addTextBoxVisualOverflow(InlineTextBox&, GlyphOverflowAndFallbackFontsMap&, LayoutRect& logicalVisualOverflow);
     312    void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow);
    312313    void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow);
    313314    void constrainToLineTopAndBottomIfNeeded(LayoutRect&) const;
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r195892 r196222  
    10041004{
    10051005    clearOverflow();
    1006 
    10071006    // Add overflow from children.
    10081007    addOverflowFromChildren();
     
    10261025    }
    10271026       
    1028     // Add visual overflow from box-shadow and border-image-outset.
     1027    // Add visual overflow from box-shadow, border-image-outset and outline.
    10291028    addVisualEffectOverflow();
    10301029
     
    14101409        LayoutRect overflowBox = overflowRectForPaintRejection(namedFlowFragment);
    14111410        flipForWritingMode(overflowBox);
    1412         adjustRectWithMaximumOutline(phase, overflowBox);
    14131411        overflowBox.moveBy(adjustedPaintOffset);
    14141412        if (!overflowBox.intersects(paintInfo.rect)
     
    33913389const RenderStyle& RenderBlock::outlineStyleForRepaint() const
    33923390{
    3393     return isAnonymousBlockContinuation() ? continuation()->style() : style();
     3391    return isAnonymousBlockContinuation() ? continuation()->style() : RenderElement::outlineStyleForRepaint();
    33943392}
    33953393
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r195892 r196222  
    562562            repaintRect = LayoutRect(repaintLogicalTop, repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft);
    563563
    564         repaintRect.inflate(view().maximalOutlineSize());
    565        
    566564        if (hasOverflowClip()) {
    567565            // Adjust repaint rect for scroll offset
     
    34633461{
    34643462    ASSERT(childrenInline());
    3465 
    3466     ensureLineBoxes();
    3467 
    34683463    for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
    34693464        LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top());
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r194496 r196222  
    19871987            region->addLayoutOverflowForBox(this, curr->paddedLayoutOverflowRect(endPadding));
    19881988        if (!hasOverflowClip()) {
    1989             addVisualOverflow(curr->visualOverflowRect(curr->lineTop(), curr->lineBottom()));
     1989            LayoutRect childVisualOverflowRect = curr->visualOverflowRect(curr->lineTop(), curr->lineBottom());
     1990            addVisualOverflow(childVisualOverflowRect);
    19901991            if (region)
    1991                 region->addVisualOverflowForBox(this, curr->visualOverflowRect(curr->lineTop(), curr->lineBottom()));
     1992                region->addVisualOverflowForBox(this, childVisualOverflowRect);
    19921993        }
    19931994    }
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r196024 r196222  
    21782178    if (style().visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
    21792179        return LayoutRect();
    2180 
    21812180    LayoutRect r = visualOverflowRect();
    2182 
    21832181    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
    21842182    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
    21852183    r.move(view().layoutDelta());
    2186    
    2187     // We have to use maximalOutlineSize() because a child might have an outline
    2188     // that projects outside of our overflowRect.
    2189     ASSERT(style().outlineSize() <= view().maximalOutlineSize());
    2190     r.inflate(view().maximalOutlineSize());
    21912184    return computeRectForRepaint(r, repaintContainer);
    21922185}
     
    45014494void RenderBox::addVisualEffectOverflow()
    45024495{
    4503     if (!style().boxShadow() && !style().hasBorderImageOutsets())
     4496    if (!style().boxShadow() && !style().hasBorderImageOutsets() && !outlineStyleForRepaint().hasOutlineInVisualOverflow())
    45044497        return;
    45054498
    4506     LayoutRect borderBox = borderBoxRect();
    4507     addVisualOverflow(applyVisualEffectOverflow(borderBox));
     4499    addVisualOverflow(applyVisualEffectOverflow(borderBoxRect()));
    45084500
    45094501    RenderFlowThread* flowThread = flowThreadContainingBlock();
     
    45494541    }
    45504542
     4543    if (outlineStyleForRepaint().hasOutlineInVisualOverflow()) {
     4544        LayoutUnit outlineSize = outlineStyleForRepaint().outlineSize();
     4545        overflowMinX = std::min(overflowMinX, borderBox.x() - outlineSize);
     4546        overflowMaxX = std::max(overflowMaxX, borderBox.maxX() + outlineSize);
     4547        overflowMinY = std::min(overflowMinY, borderBox.y() - outlineSize);
     4548        overflowMaxY = std::max(overflowMaxY, borderBox.maxY() + outlineSize);
     4549    }
    45514550    // Add in the final overflow with shadows and outsets combined.
    45524551    return LayoutRect(overflowMinX, overflowMinY, overflowMaxX - overflowMinX, overflowMaxY - overflowMinY);
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r195848 r196222  
    236236    void suspendAnimations(double time = 0);
    237237
     238    RenderBoxModelObject* continuation() const;
     239
    238240protected:
    239241    RenderBoxModelObject(Element&, Ref<RenderStyle>&&, BaseTypeFlags);
     
    254256    InterpolationQuality chooseInterpolationQuality(GraphicsContext&, Image&, const void*, const LayoutSize&);
    255257
    256     RenderBoxModelObject* continuation() const;
    257258    void setContinuation(RenderBoxModelObject*);
    258259
  • trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp

    r194496 r196222  
    125125    LayoutRect overflowRect(visualOverflowRect());
    126126    overflowRect.moveBy(boxOrigin);
    127     adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);
    128127
    129128    if (!paintInfo.rect.intersects(snappedIntRect(overflowRect)))
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r196031 r196222  
    372372#endif
    373373
    374 void RenderElement::computeMaxOutlineSize(const RenderStyle& style) const
    375 {
    376     // We need to ensure that view->maximalOutlineSize() is valid for any repaints that happen
    377     // during styleDidChange (it's used by clippedOverflowRectForRepaint()).
    378     if (!style.outlineWidth())
    379         return;
    380     float maxOutlineSize = style.outlineSize();
    381     if (style.outlineStyleIsAuto())
    382         maxOutlineSize = std::max(theme().platformFocusRingWidth() + style.outlineOffset(), maxOutlineSize);
    383 
    384     if (maxOutlineSize < view().maximalOutlineSize())
    385         return;
    386 
    387     view().setMaximalOutlineSize(maxOutlineSize);
    388 }
    389 
    390374void RenderElement::initializeStyle()
    391375{
     
    616600    if (is<RenderBlockFlow>(*this))
    617601        downcast<RenderBlockFlow>(*this).invalidateLineLayoutPath();
     602    if (hasOutlineAutoAncestor() || outlineStyleForRepaint().outlineStyleIsAuto())
     603        newChild->setHasOutlineAutoAncestor();
    618604}
    619605
     
    927913    if (isDocumentElementRenderer() || isBody())
    928914        view().frameView().updateExtendBackgroundIfNecessary();
    929 
    930     if (!oldStyle || (oldStyle->outlineSize() != newStyle.outlineSize()
    931         || (oldStyle->outlineStyleIsAuto() && !newStyle.outlineStyleIsAuto())
    932         || (!oldStyle->outlineStyleIsAuto() && newStyle.outlineStyleIsAuto())))
    933         computeMaxOutlineSize(newStyle);
    934915}
    935916
     
    10381019        frame().eventHandler().scheduleCursorUpdate();
    10391020#endif
     1021    bool hadOutlineAuto = oldStyle && oldStyle->outlineStyleIsAuto();
     1022    bool hasOutlineAuto = outlineStyleForRepaint().outlineStyleIsAuto();
     1023    if (hasOutlineAuto != hadOutlineAuto) {
     1024        updateOutlineAutoAncestor(hasOutlineAuto);
     1025        issueRepaintForOutlineAuto(hasOutlineAuto ? outlineStyleForRepaint().outlineSize() : oldStyle->outlineSize());
     1026    }
    10401027}
    10411028
     
    13161303        // ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBoundsForRepaint(repaintContainer));
    13171304        newOutlineBox = newOutlineBoxRectPtr ? *newOutlineBoxRectPtr : outlineBoundsForRepaint(repaintContainer);
    1318         if (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder(*this) && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)))
    1319             fullRepaint = true;
     1305        fullRepaint = (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder(*this) && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)));
    13201306    }
    13211307
     
    21042090#if PLATFORM(MAC)
    21052091    bool needsRepaint;
    2106     paintInfo.context().drawFocusRing(focusRingRects, theme().platformFocusRingWidth(), style.outlineOffset(), document().page()->focusController().timeSinceFocusWasSet(), needsRepaint);
     2092    paintInfo.context().drawFocusRing(focusRingRects, style.outlineWidth(), style.outlineOffset(), document().page()->focusController().timeSinceFocusWasSet(), needsRepaint);
    21072093    if (needsRepaint)
    21082094        document().page()->focusController().setFocusedElementNeedsRepaint();
     
    21802166}
    21812167
    2182 }
     2168void RenderElement::issueRepaintForOutlineAuto(float outlineSize)
     2169{
     2170    LayoutRect repaintRect;
     2171    Vector<IntRect> focusRingRects;
     2172    addFocusRingRects(focusRingRects, LayoutPoint(), containerForRepaint());
     2173    for (auto rect : focusRingRects) {
     2174        rect.inflate(outlineSize);
     2175        repaintRect.unite(rect);
     2176    }
     2177    repaintRectangle(repaintRect);
     2178}
     2179
     2180void RenderElement::updateOutlineAutoAncestor(bool hasOutlineAuto) const
     2181{
     2182    for (auto* child = firstChild(); child; child = child->nextSibling()) {
     2183        if (hasOutlineAuto == child->hasOutlineAutoAncestor())
     2184            continue;
     2185        child->setHasOutlineAutoAncestor(hasOutlineAuto);
     2186        bool childHasOutlineAuto = child->outlineStyleForRepaint().outlineStyleIsAuto();
     2187        if (childHasOutlineAuto)
     2188            continue;
     2189        if (!is<RenderElement>(child))
     2190            continue;
     2191        downcast<RenderElement>(*child).updateOutlineAutoAncestor(hasOutlineAuto);
     2192    }
     2193    if (hasContinuation())
     2194        downcast<RenderBoxModelObject>(*this).continuation()->updateOutlineAutoAncestor(hasOutlineAuto);
     2195}
     2196
     2197}
  • trunk/Source/WebCore/rendering/RenderElement.h

    r194496 r196222  
    217217
    218218    bool childRequiresTable(const RenderObject& child) const;
     219    bool hasContinuation() const { return m_hasContinuation; }
    219220
    220221protected:
     
    256257
    257258    void setHasContinuation(bool b) { m_hasContinuation = b; }
    258     bool hasContinuation() const { return m_hasContinuation; }
    259259
    260260    static bool hasControlStatesForRenderer(const RenderObject*);
     
    277277    void paintFocusRing(PaintInfo&, const LayoutPoint&, const RenderStyle&);
    278278    void paintOutline(PaintInfo&, const LayoutRect&);
     279    void updateOutlineAutoAncestor(bool hasOutlineAuto) const;
    279280
    280281private:
     
    315316   
    316317    bool shouldWillChangeCreateStackingContext() const;
    317 
    318     void computeMaxOutlineSize(const RenderStyle&) const;
     318    void issueRepaintForOutlineAuto(float outlineSize);
    319319
    320320    unsigned m_baseTypeFlags : 6;
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r195306 r196222  
    16451645    float outlineOffset = style().outlineOffset();
    16461646    EBorderStyle outlineStyle = styleToUse.outlineStyle();
    1647 
    16481647    bool antialias = shouldAntialiasLines(graphicsContext);
    1649 
    16501648
    16511649    LayoutRect box(LayoutPoint(paintOffset.x() + thisline.x() - outlineOffset, paintOffset.y() + thisline.y() - outlineOffset),
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r195724 r196222  
    56135613        foregroundRect = backgroundRect;
    56145614        outlineRect = backgroundRect;
    5615 
    5616         // If the region does not clip its overflow, inflate the outline rect.
    5617         if (namedFlowFragment) {
    5618             if (!(namedFlowFragment->parent()->hasOverflowClip() && (&namedFlowFragment->fragmentContainerLayer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)))
    5619                 outlineRect.inflate(renderer().view().maximalOutlineSize());
    5620         }
    56215615    }
    56225616
     
    56575651            if (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)
    56585652                backgroundRect.intersect(bounds);
    5659            
    56605653            // Boxes inside flow threads don't have their logical left computed to avoid
    56615654            // floats. Instead, that information is kept in their RenderBoxRegionInfo structure.
     
    57705763
    57715764    // If we aren't an inline flow, and our layer bounds do intersect the damage rect, then we can return true.
    5772     if (!renderer().isRenderInline()) {
    5773         LayoutRect b = layerBounds;
    5774         b.inflate(renderer().view().maximalOutlineSize());
    5775         if (b.intersects(damageRect))
    5776             return true;
    5777     }
     5765    if (!renderer().isRenderInline() && layerBounds.intersects(damageRect))
     5766        return true;
    57785767
    57795768    RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment();
     
    57835772    // to the flow thread, not the last region (in which it will end up because of bottom:0px)
    57845773    if (namedFlowFragment && renderer().flowThreadContainingBlock()) {
    5785         LayoutRect b = layerBounds;
    5786         b.moveBy(namedFlowFragment->visualOverflowRectForBox(downcast<RenderBoxModelObject>(renderer())).location());
    5787         b.inflate(renderer().view().maximalOutlineSize());
    5788         if (b.intersects(damageRect))
     5774        LayoutRect adjustedBounds = layerBounds;
     5775        adjustedBounds.moveBy(namedFlowFragment->visualOverflowRectForBox(downcast<RenderBoxModelObject>(renderer())).location());
     5776        if (adjustedBounds.intersects(damageRect))
    57895777            return true;
    57905778    }
     
    58375825        }
    58385826    }
    5839 
    5840     result.inflate(renderer().view().maximalOutlineSize());
    58415827    return result;
    58425828}
     
    59265912
    59275913    LayoutRect boundingBoxRect = localBoundingBox(flags);
    5928 
    59295914    if (renderer().view().frameView().hasFlippedBlockRenderers()) {
    59305915        if (is<RenderBox>(renderer()))
  • trunk/Source/WebCore/rendering/RenderLineBoxList.cpp

    r188744 r196222  
    181181}
    182182
    183 bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, const LayoutRect& rect, const LayoutPoint& offset, bool usePrintRect, LayoutUnit outlineSize) const
     183bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, const LayoutRect& rect, const LayoutPoint& offset, bool usePrintRect) const
    184184{
    185185    // We can check the first box and last box and avoid painting/hit testing if we don't
     
    195195    if (usePrintRect && !lastLineBox()->parent())
    196196        lastLineBottom = std::max(lastLineBottom, lastRootBox.lineBottom());
    197     LayoutUnit logicalTop = firstLineTop - outlineSize;
    198     LayoutUnit logicalBottom = outlineSize + lastLineBottom;
    199    
    200     return rangeIntersectsRect(renderer, logicalTop, logicalBottom, rect, offset);
    201 }
    202 
    203 static bool isOutlinePhase(PaintPhase phase)
    204 {
    205     return phase == PaintPhaseOutline || phase == PaintPhaseSelfOutline || phase == PaintPhaseChildOutlines;
     197    return rangeIntersectsRect(renderer, firstLineTop, lastLineBottom, rect, offset);
    206198}
    207199
     
    209201{
    210202    const RootInlineBox& rootBox = box->root();
    211     const LayoutUnit outlineSize = isOutlinePhase(paintInfo.phase) ? renderer->view().maximalOutlineSize() : 0;
    212     LayoutUnit logicalTop = std::min(box->logicalTopVisualOverflow(rootBox.lineTop()), rootBox.selectionTop()) - outlineSize;
    213     LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(rootBox.lineBottom()) + outlineSize;
    214    
     203    LayoutUnit logicalTop = std::min(box->logicalTopVisualOverflow(rootBox.lineTop()), rootBox.selectionTop());
     204    LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(rootBox.lineBottom());
    215205    return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.rect, offset);
    216206}
     
    228218    RenderView& v = renderer->view();
    229219    bool usePrintRect = !v.printRect().isEmpty();
    230     LayoutUnit outlineSize = isOutlinePhase(paintInfo.phase) ? v.maximalOutlineSize() : 0;
    231     if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset, usePrintRect, outlineSize))
     220    if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset, usePrintRect))
    232221        return;
    233222
  • trunk/Source/WebCore/rendering/RenderLineBoxList.h

    r182127 r196222  
    7171
    7272private:
    73     bool anyLineIntersectsRect(RenderBoxModelObject*, const LayoutRect&, const LayoutPoint&, bool usePrintRect = false, LayoutUnit outlineSize = 0) const;
     73    bool anyLineIntersectsRect(RenderBoxModelObject*, const LayoutRect&, const LayoutPoint&, bool usePrintRect = false) const;
    7474    bool lineIntersectsDirtyRect(RenderBoxModelObject*, InlineFlowBox*, const PaintInfo&, const LayoutPoint&) const;
    7575    bool rangeIntersectsRect(RenderBoxModelObject*, LayoutUnit logicalTop, LayoutUnit logicalBottom, const LayoutRect&, const LayoutPoint&) const;
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r195180 r196222  
    6060#include "SpatialNavigation.h"
    6161#include "StyleResolver.h"
     62#include "StyleTreeResolver.h"
    6263#include "WheelEventTestTrigger.h"
    6364#include <math.h>
     
    199200void RenderListBox::computePreferredLogicalWidths()
    200201{
    201     ASSERT(!m_optionsChanged);
     202    // Nested style recal do not fire post recal callbacks. see webkit.org/b/153767
     203    ASSERT(!m_optionsChanged || Style::postResolutionCallbacksAreSuspended());
    202204
    203205    m_minPreferredLogicalWidth = 0;
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r194496 r196222  
    11851185    LayoutRect overflowRect(visualOverflowRect());
    11861186    overflowRect.moveBy(boxOrigin);
    1187     adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);
    1188 
    11891187    if (!paintInfo.rect.intersects(overflowRect))
    11901188        return;
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r195918 r196222  
    889889}
    890890
     891void RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded(const RenderLayerModelObject& repaintContainer, const LayoutRect& repaintRect) const
     892{
     893    if (!hasOutlineAutoAncestor())
     894        return;
     895
     896    // FIXME: We should really propagate only when the the child renderer sticks out.
     897    bool repaintRectNeedsConverting = false;
     898    // Issue repaint on the renderer with outline: auto.
     899    for (const auto* renderer = this; renderer; renderer = renderer->parent()) {
     900        bool rendererHasOutlineAutoAncestor = renderer->hasOutlineAutoAncestor();
     901        ASSERT(rendererHasOutlineAutoAncestor
     902            || renderer->outlineStyleForRepaint().outlineStyleIsAuto()
     903            || (is<RenderElement>(*renderer) && downcast<RenderElement>(*renderer).hasContinuation()));
     904        if (renderer == &repaintContainer && rendererHasOutlineAutoAncestor)
     905            repaintRectNeedsConverting = true;
     906        if (rendererHasOutlineAutoAncestor)
     907            continue;
     908        // Issue repaint on the correct repaint container.
     909        LayoutRect adjustedRepaintRect = repaintRect;
     910        adjustedRepaintRect.inflate(renderer->outlineStyleForRepaint().outlineSize());
     911        if (!repaintRectNeedsConverting)
     912            repaintContainer.repaintRectangle(adjustedRepaintRect);
     913        else if (is<RenderLayerModelObject>(renderer)) {
     914            const auto& rendererWithOutline = downcast<RenderLayerModelObject>(*renderer);
     915            adjustedRepaintRect = LayoutRect(repaintContainer.localToContainerQuad(FloatRect(adjustedRepaintRect), &rendererWithOutline).boundingBox());
     916            rendererWithOutline.repaintRectangle(adjustedRepaintRect);
     917        }
     918        return;
     919    }
     920    ASSERT_NOT_REACHED();
     921}
     922
    891923void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const LayoutRect& r, bool shouldClipToLayer) const
    892924{
     
    901933        return;
    902934    }
     935
     936    propagateRepaintToParentWithOutlineAutoIfNeeded(*repaintContainer, r);
    903937
    904938    if (repaintContainer->hasFilter() && repaintContainer->layer() && repaintContainer->layer()->requiresFullLayerImageForFilters()) {
     
    919953        }
    920954    }
    921    
    922955
    923956    if (view().usesCompositing()) {
     
    19201953#endif
    19211954
    1922 void RenderObject::adjustRectWithMaximumOutline(PaintPhase phase, LayoutRect& rect) const
    1923 {
    1924     if (phase != PaintPhaseOutline && phase != PaintPhaseSelfOutline && phase != PaintPhaseChildOutlines)
    1925         return;
    1926     rect.inflate(view().maximalOutlineSize());
    1927 }
    1928 
    19291955int RenderObject::caretMinOffset() const
    19301956{
     
    19581984void RenderObject::adjustRectForOutlineAndShadow(LayoutRect& rect) const
    19591985{
    1960     float outlineSize = outlineStyleForRepaint().outlineSize();
    1961     if (outlineStyleForRepaint().outlineStyleIsAuto())
    1962         outlineSize = std::max(theme().platformFocusRingWidth() + outlineStyleForRepaint().outlineOffset(), outlineSize);
     1986    LayoutUnit outlineSize = outlineStyleForRepaint().outlineSize();
    19631987    if (const ShadowData* boxShadow = style().boxShadow()) {
    19641988        boxShadow->adjustRectForShadow(rect, outlineSize);
     
    22112235}
    22122236
     2237void RenderObject::setHasOutlineAutoAncestor(bool hasOutlineAutoAncestor)
     2238{
     2239    if (hasOutlineAutoAncestor || hasRareData())
     2240        ensureRareData().setHasOutlineAutoAncestor(hasOutlineAutoAncestor);
     2241}
     2242
    22132243void RenderObject::setIsRegisteredForVisibleInViewportCallback(bool registered)
    22142244{
  • trunk/Source/WebCore/rendering/RenderObject.h

    r195397 r196222  
    502502    bool hasReflection() const { return m_bitfields.hasRareData() && rareData().hasReflection(); }
    503503    bool isRenderFlowThread() const { return m_bitfields.hasRareData() && rareData().isRenderFlowThread(); }
     504    bool hasOutlineAutoAncestor() const { return m_bitfields.hasRareData() && rareData().hasOutlineAutoAncestor(); }
    504505    bool isRegisteredForVisibleInViewportCallback() { return m_bitfields.hasRareData() && rareData().isRegisteredForVisibleInViewportCallback(); }
    505506
     
    619620    void setHasReflection(bool = true);
    620621    void setIsRenderFlowThread(bool = true);
     622    void setHasOutlineAutoAncestor(bool = true);
    621623    void setIsRegisteredForVisibleInViewportCallback(bool);
    622624    void setVisibleInViewportState(VisibleInViewportState);
     
    752754    bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
    753755
    754     // Applied as a "slop" to dirty rect checks during the outline painting phase's dirty-rect checks.
    755     void adjustRectWithMaximumOutline(PaintPhase, LayoutRect&) const;
    756 
    757756    enum SelectionState {
    758757        SelectionNone, // The object is not selected.
     
    886885    void removeFromRenderFlowThreadIncludingDescendants(bool);
    887886    Node* generatingPseudoHostElement() const;
     887
     888    void propagateRepaintToParentWithOutlineAutoIfNeeded(const RenderLayerModelObject& repaintContainer, const LayoutRect& repaintRect) const;
    888889
    889890    virtual bool isWBR() const { ASSERT_NOT_REACHED(); return false; }
     
    10271028            , m_hasReflection(false)
    10281029            , m_isRenderFlowThread(false)
     1030            , m_hasOutlineAutoAncestor(false)
    10291031            , m_isRegisteredForVisibleInViewportCallback(false)
    10301032            , m_visibleInViewportState(VisibilityUnknown)
     
    10341036        ADD_BOOLEAN_BITFIELD(hasReflection, HasReflection);
    10351037        ADD_BOOLEAN_BITFIELD(isRenderFlowThread, IsRenderFlowThread);
     1038        ADD_BOOLEAN_BITFIELD(hasOutlineAutoAncestor, HasOutlineAutoAncestor);
    10361039
    10371040        // From RenderElement
  • trunk/Source/WebCore/rendering/RenderOverflow.h

    r159609 r196222  
    3636// could spill out of a line box.
    3737   
    38 // Examples of visual overflow are shadows, text stroke (and eventually outline and border-image).
     38// Examples of visual overflow are shadows, text stroke, outline (and eventually border-image).
    3939
    4040// This object is allocated only when some of these fields have non-default values in the owning box.
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r194496 r196222  
    153153{
    154154    ASSERT(isValid());
    155 
    156155    if (shouldClipFlowThreadContent())
    157156        return flowThreadPortionRect;
    158157
    159158    LayoutRect flowThreadOverflow = overflowType == VisualOverflow ? visualOverflowRectForBox(*m_flowThread) : layoutOverflowRectForBox(m_flowThread);
    160 
    161     // We are interested about the outline size only when computing the visual overflow.
    162     LayoutUnit outlineSize = overflowType == VisualOverflow ? LayoutUnit(view().maximalOutlineSize()) : LayoutUnit();
    163159    LayoutRect clipRect;
    164160    if (m_flowThread->isHorizontalWritingMode()) {
    165         LayoutUnit minY = isFirstPortion ? (flowThreadOverflow.y() - outlineSize) : flowThreadPortionRect.y();
    166         LayoutUnit maxY = isLastPortion ? std::max(flowThreadPortionRect.maxY(), flowThreadOverflow.maxY()) + outlineSize : flowThreadPortionRect.maxY();
     161        LayoutUnit minY = isFirstPortion ? flowThreadOverflow.y() : flowThreadPortionRect.y();
     162        LayoutUnit maxY = isLastPortion ? std::max(flowThreadPortionRect.maxY(), flowThreadOverflow.maxY()) : flowThreadPortionRect.maxY();
    167163        bool clipX = style().overflowX() != OVISIBLE;
    168         LayoutUnit minX = clipX ? flowThreadPortionRect.x() : std::min(flowThreadPortionRect.x(), flowThreadOverflow.x() - outlineSize);
    169         LayoutUnit maxX = clipX ? flowThreadPortionRect.maxX() : std::max(flowThreadPortionRect.maxX(), (flowThreadOverflow.maxX() + outlineSize));
     164        LayoutUnit minX = clipX ? flowThreadPortionRect.x() : std::min(flowThreadPortionRect.x(), flowThreadOverflow.x());
     165        LayoutUnit maxX = clipX ? flowThreadPortionRect.maxX() : std::max(flowThreadPortionRect.maxX(), flowThreadOverflow.maxX());
    170166        clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
    171167    } else {
    172         LayoutUnit minX = isFirstPortion ? (flowThreadOverflow.x() - outlineSize) : flowThreadPortionRect.x();
    173         LayoutUnit maxX = isLastPortion ? std::max(flowThreadPortionRect.maxX(), flowThreadOverflow.maxX()) + outlineSize : flowThreadPortionRect.maxX();
     168        LayoutUnit minX = isFirstPortion ? flowThreadOverflow.x() : flowThreadPortionRect.x();
     169        LayoutUnit maxX = isLastPortion ? std::max(flowThreadPortionRect.maxX(), flowThreadOverflow.maxX()) : flowThreadPortionRect.maxX();
    174170        bool clipY = style().overflowY() != OVISIBLE;
    175         LayoutUnit minY = clipY ? flowThreadPortionRect.y() : std::min(flowThreadPortionRect.y(), (flowThreadOverflow.y() - outlineSize));
    176         LayoutUnit maxY = clipY ? flowThreadPortionRect.maxY() : std::max(flowThreadPortionRect.y(), (flowThreadOverflow.maxY() + outlineSize));
     171        LayoutUnit minY = clipY ? flowThreadPortionRect.y() : std::min(flowThreadPortionRect.y(), flowThreadOverflow.y());
     172        LayoutUnit maxY = clipY ? flowThreadPortionRect.maxY() : std::max(flowThreadPortionRect.y(), flowThreadOverflow.maxY());
    177173        clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
    178174    }
    179 
    180175    return clipRect;
    181176}
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r194496 r196222  
    234234   
    235235    LayoutRect localRepaintRect = paintInfo.rect;
    236     adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);
    237236    if (adjustedPaintOffset.x() + visualOverflowRect().x() >= localRepaintRect.maxX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= localRepaintRect.x())
    238237        return false;
     
    615614    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
    616615    r.move(view().layoutDelta());
    617     r.inflate(style().outlineSize());
    618616    return computeRectForRepaint(r, repaintContainer);
    619617}
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r194496 r196222  
    661661    if (!isDocumentElementRenderer()) {
    662662        LayoutRect overflowBox = visualOverflowRect();
    663         adjustRectWithMaximumOutline(paintInfo.phase, overflowBox);
    664663        flipForWritingMode(overflowBox);
    665664        overflowBox.moveBy(adjustedPaintOffset);
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r194496 r196222  
    384384    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
    385385    r.move(view().layoutDelta());
    386 
    387386    return computeRectForRepaint(r, repaintContainer);
    388387}
     
    11831182
    11841183    LayoutRect localRepaintRect = paintInfo.rect;
    1185     adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);
    1186 
    11871184    LayoutRect paintRect = LayoutRect(paintOffset + location(), frameRect().size());
    11881185    if (paintRect.y() - table()->outerBorderTop() >= localRepaintRect.maxY())
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r194496 r196222  
    179179    }
    180180
     181    clearOverflow();
     182    addVisualEffectOverflow();
    181183    // We only ever need to repaint if our cells didn't, which menas that they didn't need
    182184    // layout, so we know that our bounds didn't change. This code is just making up for
     
    197199{
    198200    ASSERT(parent());
    199    
    200201    // Rows and cells are in the same coordinate space. We need to both compute our overflow rect (which
    201202    // will accommodate a row outline and any visual effects on the row itself), but we also need to add in
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r194867 r196222  
    538538            rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing);
    539539            rowRenderer->updateLayerTransform();
     540            rowRenderer->clearOverflow();
     541            rowRenderer->addVisualEffectOverflow();
    540542        }
    541543
     
    708710        }
    709711    }
    710 
    711712    ASSERT(hasOverflowingCell == this->hasOverflowingCell());
    712713}
     
    12311232{
    12321233    LayoutRect localRepaintRect = paintInfo.rect;
    1233     adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);
    12341234    localRepaintRect.moveBy(-paintOffset);
    12351235
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r194817 r196222  
    2424#define RenderTheme_h
    2525
     26#include "BorderData.h"
    2627#include "ControlStates.h"
     28#include "FillLayer.h"
    2729#if USE(NEW_THEME)
    2830#include "Theme.h"
     
    3032#include "ThemeTypes.h"
    3133#endif
     34#include "PaintInfo.h"
    3235#include "PopupMenuStyle.h"
    3336#include "RenderObject.h"
     
    164167    virtual Color platformFocusRingColor() const { return Color(0, 0, 0); }
    165168    static void setCustomFocusRingColor(const Color&);
    166     virtual int platformFocusRingWidth() const { return 3; }
     169    static float platformFocusRingWidth() { return 3; }
     170    static float platformFocusRingOffset(float outlineWidth) { return std::max<float>(outlineWidth - platformFocusRingWidth(), 0); }
    167171#if ENABLE(TOUCH_EVENTS)
    168172    static Color tapHighlightColor();
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r195591 r196222  
    826826}
    827827
    828 // Compositing layer dimensions take outline size into account, so we have to recompute layer
    829 // bounds when it changes.
    830 // FIXME: This is ugly; it would be nice to have a better way to do this.
    831 void RenderView::setMaximalOutlineSize(float outlineSize)
    832 {
    833     if (outlineSize == m_maximalOutlineSize)
    834         return;
    835    
    836     m_maximalOutlineSize = outlineSize;
    837     // maximalOutlineSize affects compositing layer dimensions.
    838     // FIXME: this really just needs to be a geometry update.
    839     compositor().setCompositingLayersNeedRebuild();
    840 }
    841 
    842828void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* end, int endPos, SelectionRepaintMode blockRepaintMode)
    843829{
  • trunk/Source/WebCore/rendering/RenderView.h

    r194496 r196222  
    9999    virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
    100100
    101     void setMaximalOutlineSize(float);
    102     float maximalOutlineSize() const { return m_maximalOutlineSize; }
    103 
    104101    LayoutRect viewRect() const;
    105102
     
    351348    // End deprecated members.
    352349
    353     // Used to inflate compositing layers and repaint rects.
    354     float m_maximalOutlineSize { 0 };
    355 
    356350    bool shouldUsePrintingLayout() const;
    357351
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r196075 r196222  
    3636#include "QuotesData.h"
    3737#include "RenderObject.h"
     38#include "RenderTheme.h"
    3839#include "ScaleTransformOperation.h"
    3940#include "ShadowData.h"
     
    5657#if ENABLE(TEXT_AUTOSIZING)
    5758#include "TextAutosizer.h"
    58 #endif
    59 
    60 #if ENABLE(TOUCH_EVENTS)
    61 #include "RenderTheme.h"
    6259#endif
    6360
     
    481478    }
    482479
     480    if (hasOutlineInVisualOverflow() != other.hasOutlineInVisualOverflow())
     481        return true;
    483482    return false;
    484483}
     
    20272026}
    20282027
     2028float RenderStyle::outlineWidth() const
     2029{
     2030    if (m_background->outline().style() == BNONE)
     2031        return 0;
     2032    if (outlineStyleIsAuto())
     2033        return std::max(m_background->outline().width(), RenderTheme::platformFocusRingWidth());
     2034    return m_background->outline().width();
     2035}
     2036
     2037float RenderStyle::outlineOffset() const
     2038{
     2039    if (m_background->outline().style() == BNONE)
     2040        return 0;
     2041    if (outlineStyleIsAuto())
     2042        return (m_background->outline().offset() + RenderTheme::platformFocusRingOffset(outlineWidth()));
     2043    return m_background->outline().offset();
     2044}
     2045
    20292046} // namespace WebCore
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r196075 r196222  
    668668
    669669    float outlineSize() const { return std::max<float>(0, outlineWidth() + outlineOffset()); }
    670     float outlineWidth() const
    671     {
    672         if (m_background->outline().style() == BNONE)
    673             return 0;
    674         return m_background->outline().width();
    675     }
    676     bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
     670    float outlineWidth() const;
     671    bool hasOutline() const { return outlineStyle() > BHIDDEN && outlineWidth() > 0; }
    677672    EBorderStyle outlineStyle() const { return m_background->outline().style(); }
    678673    OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); }
     674    bool hasOutlineInVisualOverflow() const { return hasOutline() && outlineSize() > 0; }
    679675   
    680676    EOverflow overflowX() const { return noninherited_flags.overflowX(); }
     
    883879    HangingPunctuation hangingPunctuation() const { return static_cast<HangingPunctuation>(rareInheritedData->m_hangingPunctuation); }
    884880
    885     float outlineOffset() const
    886     {
    887         if (m_background->outline().style() == BNONE)
    888             return 0;
    889         return m_background->outline().offset();
    890     }
    891 
     881    float outlineOffset() const;
    892882    const ShadowData* textShadow() const { return rareInheritedData->textShadow.get(); }
    893883    void getTextShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
Note: See TracChangeset for help on using the changeset viewer.