Changeset 196222 in webkit
- Timestamp:
- Feb 6, 2016 3:07:54 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196221 r196222 1 2016-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 1 35 2016-02-06 Michael Catanzaro <mcatanzaro@igalia.com> 2 36 -
trunk/LayoutTests/TestExpectations
r196091 r196222 852 852 loader/stateobjects/replacestate-size-iframe.html [ Slow ] 853 853 loader/stateobjects/replacestate-size.html [ Slow ] 854 855 # outline: auto -focusring. 856 imported/blink/fast/multicol/outlines-at-column-boundaries.html [ ImageOnlyFailure ] 857 fast/multicol/multicol-with-child-renderLayer-for-input.html [ ImageOnlyFailure ] -
trunk/LayoutTests/compositing/layer-creation/stacking-context-overlap-nested-expected.txt
r168244 r196222 20 20 ) 21 21 (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) 24 25 ) 25 26 ) -
trunk/LayoutTests/fast/repaint/4776765-expected.txt
r189176 r196222 3 3 4 4 (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) 18 10 (rect 8 26 1 18) 11 (rect 1 37 15 32) 19 12 (rect 8 44 1 18) 20 13 ) -
trunk/LayoutTests/fast/repaint/focus-ring-expected.txt
r149088 r196222 5 5 RenderBody {BODY} at (8,20) size 784x560 6 6 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 60x607 layer at (28,148) size 100x100 backgroundClip at (18,138) size 60x60 clip at (18,138) size 60x60 outlineClip at (18,138) size 60x60 8 8 RenderBlock (positioned) {DIV} at (28,148) size 100x100 [bgcolor=#FFFFE0] -
trunk/LayoutTests/platform/mac/TestExpectations
r196196 r196222 1323 1323 # This test is already run with run-jsc-stress-tests 1324 1324 webkit.org/b/153879 js/basic-set.html [ Skip ] 1325 1326 # outline: auto -focusring. 1327 accessibility/mac/selection-element-tabbing-to-link.html [ Pass Failure ] 1328 accessibility/mac/selection-notification-focus-change.html [ Pass Failure ] -
trunk/LayoutTests/platform/mac/compositing/geometry/ancestor-overflow-change-expected.txt
r174585 r196222 8 8 (children 1 9 9 (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) 12 13 (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]) 13 14 ) -
trunk/LayoutTests/platform/mac/compositing/geometry/composited-in-columns-expected.txt
r174585 r196222 13 13 (children 1 14 14 (GraphicsLayer 15 (bounds 60.00 60.00) 15 (position 5.00 5.00) 16 (bounds 50.00 50.00) 17 (contentsOpaque 1) 16 18 ) 17 19 ) … … 23 25 (children 1 24 26 (GraphicsLayer 25 (bounds 60.00 60.00) 27 (position 5.00 5.00) 28 (bounds 50.00 50.00) 29 (contentsOpaque 1) 26 30 ) 27 31 ) -
trunk/LayoutTests/platform/mac/compositing/layer-creation/overlap-animation-container-expected.txt
r183950 r196222 9 9 (children 3 10 10 (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) 13 14 (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]) 14 15 ) 15 16 (GraphicsLayer 16 (position 46.00 2 29.00)17 (bounds 146.00 45 4.00)17 (position 46.00 230.00) 18 (bounds 146.00 452.00) 18 19 (drawsContent 1) 19 20 (children 1 20 21 (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) 23 25 (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]) 24 26 ) … … 26 28 ) 27 29 (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) 30 33 ) 31 34 ) … … 44 47 (children 3 45 48 (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) 48 52 (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]) 49 53 ) 50 54 (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) 53 58 (drawsContent 1) 54 59 (children 4 55 60 (GraphicsLayer 56 61 (position 11.00 11.00) 57 (bounds 102.00 102.00) 62 (bounds 100.00 100.00) 63 (contentsOpaque 1) 58 64 (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]) 59 65 ) 60 66 (GraphicsLayer 61 (position 1 1.00 121.00)67 (position 10.00 120.00) 62 68 (bounds 102.00 102.00) 63 69 (drawsContent 1) … … 65 71 ) 66 72 (GraphicsLayer 67 (position 1 1.00 231.00)73 (position 10.00 230.00) 68 74 (bounds 102.00 102.00) 69 75 (drawsContent 1) … … 71 77 ) 72 78 (GraphicsLayer 73 (position 1 1.00 341.00)79 (position 10.00 340.00) 74 80 (bounds 102.00 102.00) 75 81 (drawsContent 1) … … 78 84 ) 79 85 (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) 82 89 ) 83 90 ) -
trunk/LayoutTests/platform/mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt
r168310 r196222 13 13 (children 3 14 14 (GraphicsLayer 15 (position 1 4.00 6.00)15 (position 18.00 10.00) 16 16 (anchor 0.50 0.50) 17 (bounds 7 57.00 152.00)17 (bounds 749.00 144.00) 18 18 (children 1 19 19 (GraphicsLayer 20 20 (position 20.00 20.00) 21 (bounds 10 8.00 108.00)21 (bounds 100.00 100.00) 22 22 (contentsVisible 0) 23 23 ) … … 31 31 (children 1 32 32 (GraphicsLayer 33 (position 2 0.00 20.00)34 (bounds 10 8.00 108.00)33 (position 24.00 24.00) 34 (bounds 100.00 100.00) 35 35 (contentsVisible 0) 36 36 ) … … 44 44 (children 1 45 45 (GraphicsLayer 46 (position 2 0.00 20.00)47 (bounds 10 8.00 108.00)46 (position 24.00 24.00) 47 (bounds 100.00 100.00) 48 48 ) 49 49 ) … … 64 64 (children 3 65 65 (GraphicsLayer 66 (position 1 4.00 6.00)66 (position 18.00 10.00) 67 67 (anchor 0.50 0.50) 68 (bounds 7 57.00 152.00)68 (bounds 749.00 144.00) 69 69 (children 1 70 70 (GraphicsLayer 71 71 (position 20.00 20.00) 72 (bounds 10 8.00 108.00)72 (bounds 100.00 100.00) 73 73 ) 74 74 ) … … 81 81 (children 1 82 82 (GraphicsLayer 83 (position 2 0.00 20.00)84 (bounds 10 8.00 108.00)83 (position 24.00 24.00) 84 (bounds 100.00 100.00) 85 85 (contentsVisible 0) 86 86 ) … … 94 94 (children 1 95 95 (GraphicsLayer 96 (position 2 0.00 20.00)97 (bounds 10 8.00 108.00)96 (position 24.00 24.00) 97 (bounds 100.00 100.00) 98 98 ) 99 99 ) … … 114 114 (children 3 115 115 (GraphicsLayer 116 (position 1 4.00 6.00)116 (position 18.00 10.00) 117 117 (anchor 0.50 0.50) 118 (bounds 7 57.00 152.00)118 (bounds 749.00 144.00) 119 119 (children 1 120 120 (GraphicsLayer 121 121 (position 20.00 20.00) 122 (bounds 10 8.00 108.00)122 (bounds 100.00 100.00) 123 123 ) 124 124 ) … … 131 131 (children 1 132 132 (GraphicsLayer 133 (position 2 0.00 20.00)134 (bounds 10 8.00 108.00)133 (position 24.00 24.00) 134 (bounds 100.00 100.00) 135 135 ) 136 136 ) … … 143 143 (children 1 144 144 (GraphicsLayer 145 (position 2 0.00 20.00)146 (bounds 10 8.00 108.00)145 (position 24.00 24.00) 146 (bounds 100.00 100.00) 147 147 ) 148 148 ) -
trunk/LayoutTests/platform/mac/fast/clip/outline-overflowClip-expected.txt
r177774 r196222 15 15 text run at (2,2) width 102: "text in outer div" 16 16 RenderText {#text} at (0,0) size 0x0 17 layer at (60,64) size 108x24 backgroundClip at (83,6 4) size 85x24clip at (83,67) size 82x18 outlineClip at (83,44) size 229x204 scrollWidth 10317 layer 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 18 18 RenderBlock (positioned) {DIV} at (52,20) size 108x24 [bgcolor=#EEEEEE] [border: (3px solid #FF0000)] 19 19 RenderText {#text} at (3,3) size 102x18 -
trunk/LayoutTests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.txt
r177774 r196222 32 32 RenderText {#text} at (0,0) size 84x18 33 33 text run at (0,0) width 84: "Content after" 34 layer at (8,164) size 0x035 RenderInline (relative positioned) {SPAN} at (0,0) size 0x036 34 layer at (8,164) size 784x22 37 35 RenderBlock (anonymous) at (0,0) size 784x22 … … 52 50 RenderText {#text} at (0,0) size 176x22 53 51 text run at (0,0) width 176: "But No Content After" 54 layer at (8,316) size 0x055 RenderInline (relative positioned) {SPAN} at (0,0) size 0x056 layer at (8,316) size 0x057 RenderInline (relative positioned) {SPAN} at (0,0) size 0x058 52 layer at (8,316) size 784x22 59 53 RenderBlock (anonymous) at (0,0) size 784x22 … … 61 55 RenderText {#text} at (0,0) size 214x22 62 56 text run at (0,0) width 214: "No content before or after." 63 layer at (8,357) size 0x064 RenderInline (relative positioned) {SPAN} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/fast/repaint/layer-outline-expected.txt
r177774 r196222 22 22 layer at (18,62) size 100x100 23 23 RenderBlock (positioned) {DIV} at (10,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)] 24 layer at (148,62) size 100x100 backgroundClip at (1 48,62) size 90x90 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x10024 layer at (148,62) size 100x100 backgroundClip at (138,52) size 100x100 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x100 25 25 RenderBlock (positioned) {DIV} at (140,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)] 26 layer 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)] 26 28 layer at (408,62) size 100x100 27 29 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 100x10030 layer at (538,62) size 100x100 backgroundClip at (548,72) size 100x100 clip at (548,72) size 100x100 outlineClip at (548,72) size 100x100 29 31 RenderBlock (positioned) {DIV} at (530,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)] 32 layer 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)] 30 34 layer at (18,322) size 100x100 31 35 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 22 22 layer at (18,62) size 100x100 23 23 RenderBlock (positioned) {DIV} at (10,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)] 24 layer at (148,62) size 100x100 backgroundClip at (1 48,62) size 90x90 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x10024 layer at (148,62) size 100x100 backgroundClip at (138,52) size 100x100 clip at (138,52) size 100x100 outlineClip at (138,52) size 100x100 25 25 RenderBlock (positioned) {DIV} at (140,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)] 26 layer 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)] 26 28 layer at (408,62) size 100x100 27 29 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 100x10030 layer at (538,62) size 100x100 backgroundClip at (548,72) size 100x100 clip at (548,72) size 100x100 outlineClip at (548,72) size 100x100 29 31 RenderBlock (positioned) {DIV} at (530,10) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)] 32 layer 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)] 30 34 layer at (18,322) size 100x100 31 35 RenderBlock (relative positioned) {DIV} at (0,294) size 100x100 [bgcolor=#EEEEEE] [border: (1px solid #000000)] -
trunk/Source/WebCore/ChangeLog
r196217 r196222 1 2016-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 1 111 2016-02-06 Andreas Kling <akling@apple.com> 2 112 -
trunk/Source/WebCore/css/html.css
r195685 r196222 1130 1130 1131 1131 :focus { 1132 outline: auto ;1132 outline: auto 5px -webkit-focus-ring-color; 1133 1133 } 1134 1134 … … 1136 1136 html:focus, body:focus, input[readonly]:focus, applet:focus, embed:focus, iframe:focus, object:focus { 1137 1137 outline: none; 1138 } 1139 1140 input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus { 1141 outline-offset: -2px; 1138 1142 } 1139 1143 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r191935 r196222 179 179 || (is<RenderListMarker>(child->renderer()) && !downcast<RenderListMarker>(child->renderer()).isInside()) 180 180 || childStyle.hasBorderImageOutsets())) 181 child->clearKnownToHaveNoOverflow(); 182 else if (childStyle.hasOutlineInVisualOverflow()) 181 183 child->clearKnownToHaveNoOverflow(); 182 184 … … 947 949 } 948 950 951 inline 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 949 965 inline void InlineFlowBox::addReplacedChildOverflow(const InlineBox* inlineBox, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow) 950 966 { … … 984 1000 985 1001 addBoxShadowVisualOverflow(logicalVisualOverflow); 1002 addOutlineVisualOverflow(logicalVisualOverflow); 986 1003 addBorderOutsetVisualOverflow(logicalVisualOverflow); 987 1004 … … 1147 1164 1148 1165 LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); 1149 renderer().adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);1150 1166 flipForWritingMode(overflowRect); 1151 1167 overflowRect.moveBy(paintOffset); -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r189594 r196222 310 310 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); 311 311 void addTextBoxVisualOverflow(InlineTextBox&, GlyphOverflowAndFallbackFontsMap&, LayoutRect& logicalVisualOverflow); 312 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); 312 313 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow); 313 314 void constrainToLineTopAndBottomIfNeeded(LayoutRect&) const; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r195892 r196222 1004 1004 { 1005 1005 clearOverflow(); 1006 1007 1006 // Add overflow from children. 1008 1007 addOverflowFromChildren(); … … 1026 1025 } 1027 1026 1028 // Add visual overflow from box-shadow and border-image-outset.1027 // Add visual overflow from box-shadow, border-image-outset and outline. 1029 1028 addVisualEffectOverflow(); 1030 1029 … … 1410 1409 LayoutRect overflowBox = overflowRectForPaintRejection(namedFlowFragment); 1411 1410 flipForWritingMode(overflowBox); 1412 adjustRectWithMaximumOutline(phase, overflowBox);1413 1411 overflowBox.moveBy(adjustedPaintOffset); 1414 1412 if (!overflowBox.intersects(paintInfo.rect) … … 3391 3389 const RenderStyle& RenderBlock::outlineStyleForRepaint() const 3392 3390 { 3393 return isAnonymousBlockContinuation() ? continuation()->style() : style();3391 return isAnonymousBlockContinuation() ? continuation()->style() : RenderElement::outlineStyleForRepaint(); 3394 3392 } 3395 3393 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r195892 r196222 562 562 repaintRect = LayoutRect(repaintLogicalTop, repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft); 563 563 564 repaintRect.inflate(view().maximalOutlineSize());565 566 564 if (hasOverflowClip()) { 567 565 // Adjust repaint rect for scroll offset … … 3463 3461 { 3464 3462 ASSERT(childrenInline()); 3465 3466 ensureLineBoxes();3467 3468 3463 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { 3469 3464 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r194496 r196222 1987 1987 region->addLayoutOverflowForBox(this, curr->paddedLayoutOverflowRect(endPadding)); 1988 1988 if (!hasOverflowClip()) { 1989 addVisualOverflow(curr->visualOverflowRect(curr->lineTop(), curr->lineBottom())); 1989 LayoutRect childVisualOverflowRect = curr->visualOverflowRect(curr->lineTop(), curr->lineBottom()); 1990 addVisualOverflow(childVisualOverflowRect); 1990 1991 if (region) 1991 region->addVisualOverflowForBox(this, c urr->visualOverflowRect(curr->lineTop(), curr->lineBottom()));1992 region->addVisualOverflowForBox(this, childVisualOverflowRect); 1992 1993 } 1993 1994 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r196024 r196222 2178 2178 if (style().visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent()) 2179 2179 return LayoutRect(); 2180 2181 2180 LayoutRect r = visualOverflowRect(); 2182 2183 2181 // FIXME: layoutDelta needs to be applied in parts before/after transforms and 2184 2182 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 2185 2183 r.move(view().layoutDelta()); 2186 2187 // We have to use maximalOutlineSize() because a child might have an outline2188 // that projects outside of our overflowRect.2189 ASSERT(style().outlineSize() <= view().maximalOutlineSize());2190 r.inflate(view().maximalOutlineSize());2191 2184 return computeRectForRepaint(r, repaintContainer); 2192 2185 } … … 4501 4494 void RenderBox::addVisualEffectOverflow() 4502 4495 { 4503 if (!style().boxShadow() && !style().hasBorderImageOutsets() )4496 if (!style().boxShadow() && !style().hasBorderImageOutsets() && !outlineStyleForRepaint().hasOutlineInVisualOverflow()) 4504 4497 return; 4505 4498 4506 LayoutRect borderBox = borderBoxRect(); 4507 addVisualOverflow(applyVisualEffectOverflow(borderBox)); 4499 addVisualOverflow(applyVisualEffectOverflow(borderBoxRect())); 4508 4500 4509 4501 RenderFlowThread* flowThread = flowThreadContainingBlock(); … … 4549 4541 } 4550 4542 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 } 4551 4550 // Add in the final overflow with shadows and outsets combined. 4552 4551 return LayoutRect(overflowMinX, overflowMinY, overflowMaxX - overflowMinX, overflowMaxY - overflowMinY); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r195848 r196222 236 236 void suspendAnimations(double time = 0); 237 237 238 RenderBoxModelObject* continuation() const; 239 238 240 protected: 239 241 RenderBoxModelObject(Element&, Ref<RenderStyle>&&, BaseTypeFlags); … … 254 256 InterpolationQuality chooseInterpolationQuality(GraphicsContext&, Image&, const void*, const LayoutSize&); 255 257 256 RenderBoxModelObject* continuation() const;257 258 void setContinuation(RenderBoxModelObject*); 258 259 -
trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp
r194496 r196222 125 125 LayoutRect overflowRect(visualOverflowRect()); 126 126 overflowRect.moveBy(boxOrigin); 127 adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);128 127 129 128 if (!paintInfo.rect.intersects(snappedIntRect(overflowRect))) -
trunk/Source/WebCore/rendering/RenderElement.cpp
r196031 r196222 372 372 #endif 373 373 374 void RenderElement::computeMaxOutlineSize(const RenderStyle& style) const375 {376 // We need to ensure that view->maximalOutlineSize() is valid for any repaints that happen377 // 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 390 374 void RenderElement::initializeStyle() 391 375 { … … 616 600 if (is<RenderBlockFlow>(*this)) 617 601 downcast<RenderBlockFlow>(*this).invalidateLineLayoutPath(); 602 if (hasOutlineAutoAncestor() || outlineStyleForRepaint().outlineStyleIsAuto()) 603 newChild->setHasOutlineAutoAncestor(); 618 604 } 619 605 … … 927 913 if (isDocumentElementRenderer() || isBody()) 928 914 view().frameView().updateExtendBackgroundIfNecessary(); 929 930 if (!oldStyle || (oldStyle->outlineSize() != newStyle.outlineSize()931 || (oldStyle->outlineStyleIsAuto() && !newStyle.outlineStyleIsAuto())932 || (!oldStyle->outlineStyleIsAuto() && newStyle.outlineStyleIsAuto())))933 computeMaxOutlineSize(newStyle);934 915 } 935 916 … … 1038 1019 frame().eventHandler().scheduleCursorUpdate(); 1039 1020 #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 } 1040 1027 } 1041 1028 … … 1316 1303 // ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBoundsForRepaint(repaintContainer)); 1317 1304 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))); 1320 1306 } 1321 1307 … … 2104 2090 #if PLATFORM(MAC) 2105 2091 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); 2107 2093 if (needsRepaint) 2108 2094 document().page()->focusController().setFocusedElementNeedsRepaint(); … … 2180 2166 } 2181 2167 2182 } 2168 void 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 2180 void 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 217 217 218 218 bool childRequiresTable(const RenderObject& child) const; 219 bool hasContinuation() const { return m_hasContinuation; } 219 220 220 221 protected: … … 256 257 257 258 void setHasContinuation(bool b) { m_hasContinuation = b; } 258 bool hasContinuation() const { return m_hasContinuation; }259 259 260 260 static bool hasControlStatesForRenderer(const RenderObject*); … … 277 277 void paintFocusRing(PaintInfo&, const LayoutPoint&, const RenderStyle&); 278 278 void paintOutline(PaintInfo&, const LayoutRect&); 279 void updateOutlineAutoAncestor(bool hasOutlineAuto) const; 279 280 280 281 private: … … 315 316 316 317 bool shouldWillChangeCreateStackingContext() const; 317 318 void computeMaxOutlineSize(const RenderStyle&) const; 318 void issueRepaintForOutlineAuto(float outlineSize); 319 319 320 320 unsigned m_baseTypeFlags : 6; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r195306 r196222 1645 1645 float outlineOffset = style().outlineOffset(); 1646 1646 EBorderStyle outlineStyle = styleToUse.outlineStyle(); 1647 1648 1647 bool antialias = shouldAntialiasLines(graphicsContext); 1649 1650 1648 1651 1649 LayoutRect box(LayoutPoint(paintOffset.x() + thisline.x() - outlineOffset, paintOffset.y() + thisline.y() - outlineOffset), -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r195724 r196222 5613 5613 foregroundRect = backgroundRect; 5614 5614 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 }5621 5615 } 5622 5616 … … 5657 5651 if (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip) 5658 5652 backgroundRect.intersect(bounds); 5659 5660 5653 // Boxes inside flow threads don't have their logical left computed to avoid 5661 5654 // floats. Instead, that information is kept in their RenderBoxRegionInfo structure. … … 5770 5763 5771 5764 // 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; 5778 5767 5779 5768 RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment(); … … 5783 5772 // to the flow thread, not the last region (in which it will end up because of bottom:0px) 5784 5773 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)) 5789 5777 return true; 5790 5778 } … … 5837 5825 } 5838 5826 } 5839 5840 result.inflate(renderer().view().maximalOutlineSize());5841 5827 return result; 5842 5828 } … … 5926 5912 5927 5913 LayoutRect boundingBoxRect = localBoundingBox(flags); 5928 5929 5914 if (renderer().view().frameView().hasFlippedBlockRenderers()) { 5930 5915 if (is<RenderBox>(renderer())) -
trunk/Source/WebCore/rendering/RenderLineBoxList.cpp
r188744 r196222 181 181 } 182 182 183 bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, const LayoutRect& rect, const LayoutPoint& offset, bool usePrintRect , LayoutUnit outlineSize) const183 bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, const LayoutRect& rect, const LayoutPoint& offset, bool usePrintRect) const 184 184 { 185 185 // We can check the first box and last box and avoid painting/hit testing if we don't … … 195 195 if (usePrintRect && !lastLineBox()->parent()) 196 196 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); 206 198 } 207 199 … … 209 201 { 210 202 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()); 215 205 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.rect, offset); 216 206 } … … 228 218 RenderView& v = renderer->view(); 229 219 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)) 232 221 return; 233 222 -
trunk/Source/WebCore/rendering/RenderLineBoxList.h
r182127 r196222 71 71 72 72 private: 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; 74 74 bool lineIntersectsDirtyRect(RenderBoxModelObject*, InlineFlowBox*, const PaintInfo&, const LayoutPoint&) const; 75 75 bool rangeIntersectsRect(RenderBoxModelObject*, LayoutUnit logicalTop, LayoutUnit logicalBottom, const LayoutRect&, const LayoutPoint&) const; -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r195180 r196222 60 60 #include "SpatialNavigation.h" 61 61 #include "StyleResolver.h" 62 #include "StyleTreeResolver.h" 62 63 #include "WheelEventTestTrigger.h" 63 64 #include <math.h> … … 199 200 void RenderListBox::computePreferredLogicalWidths() 200 201 { 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()); 202 204 203 205 m_minPreferredLogicalWidth = 0; -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r194496 r196222 1185 1185 LayoutRect overflowRect(visualOverflowRect()); 1186 1186 overflowRect.moveBy(boxOrigin); 1187 adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);1188 1189 1187 if (!paintInfo.rect.intersects(overflowRect)) 1190 1188 return; -
trunk/Source/WebCore/rendering/RenderObject.cpp
r195918 r196222 889 889 } 890 890 891 void 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 891 923 void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const LayoutRect& r, bool shouldClipToLayer) const 892 924 { … … 901 933 return; 902 934 } 935 936 propagateRepaintToParentWithOutlineAutoIfNeeded(*repaintContainer, r); 903 937 904 938 if (repaintContainer->hasFilter() && repaintContainer->layer() && repaintContainer->layer()->requiresFullLayerImageForFilters()) { … … 919 953 } 920 954 } 921 922 955 923 956 if (view().usesCompositing()) { … … 1920 1953 #endif 1921 1954 1922 void RenderObject::adjustRectWithMaximumOutline(PaintPhase phase, LayoutRect& rect) const1923 {1924 if (phase != PaintPhaseOutline && phase != PaintPhaseSelfOutline && phase != PaintPhaseChildOutlines)1925 return;1926 rect.inflate(view().maximalOutlineSize());1927 }1928 1929 1955 int RenderObject::caretMinOffset() const 1930 1956 { … … 1958 1984 void RenderObject::adjustRectForOutlineAndShadow(LayoutRect& rect) const 1959 1985 { 1960 float outlineSize = outlineStyleForRepaint().outlineSize(); 1961 if (outlineStyleForRepaint().outlineStyleIsAuto()) 1962 outlineSize = std::max(theme().platformFocusRingWidth() + outlineStyleForRepaint().outlineOffset(), outlineSize); 1986 LayoutUnit outlineSize = outlineStyleForRepaint().outlineSize(); 1963 1987 if (const ShadowData* boxShadow = style().boxShadow()) { 1964 1988 boxShadow->adjustRectForShadow(rect, outlineSize); … … 2211 2235 } 2212 2236 2237 void RenderObject::setHasOutlineAutoAncestor(bool hasOutlineAutoAncestor) 2238 { 2239 if (hasOutlineAutoAncestor || hasRareData()) 2240 ensureRareData().setHasOutlineAutoAncestor(hasOutlineAutoAncestor); 2241 } 2242 2213 2243 void RenderObject::setIsRegisteredForVisibleInViewportCallback(bool registered) 2214 2244 { -
trunk/Source/WebCore/rendering/RenderObject.h
r195397 r196222 502 502 bool hasReflection() const { return m_bitfields.hasRareData() && rareData().hasReflection(); } 503 503 bool isRenderFlowThread() const { return m_bitfields.hasRareData() && rareData().isRenderFlowThread(); } 504 bool hasOutlineAutoAncestor() const { return m_bitfields.hasRareData() && rareData().hasOutlineAutoAncestor(); } 504 505 bool isRegisteredForVisibleInViewportCallback() { return m_bitfields.hasRareData() && rareData().isRegisteredForVisibleInViewportCallback(); } 505 506 … … 619 620 void setHasReflection(bool = true); 620 621 void setIsRenderFlowThread(bool = true); 622 void setHasOutlineAutoAncestor(bool = true); 621 623 void setIsRegisteredForVisibleInViewportCallback(bool); 622 624 void setVisibleInViewportState(VisibleInViewportState); … … 752 754 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); } 753 755 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 757 756 enum SelectionState { 758 757 SelectionNone, // The object is not selected. … … 886 885 void removeFromRenderFlowThreadIncludingDescendants(bool); 887 886 Node* generatingPseudoHostElement() const; 887 888 void propagateRepaintToParentWithOutlineAutoIfNeeded(const RenderLayerModelObject& repaintContainer, const LayoutRect& repaintRect) const; 888 889 889 890 virtual bool isWBR() const { ASSERT_NOT_REACHED(); return false; } … … 1027 1028 , m_hasReflection(false) 1028 1029 , m_isRenderFlowThread(false) 1030 , m_hasOutlineAutoAncestor(false) 1029 1031 , m_isRegisteredForVisibleInViewportCallback(false) 1030 1032 , m_visibleInViewportState(VisibilityUnknown) … … 1034 1036 ADD_BOOLEAN_BITFIELD(hasReflection, HasReflection); 1035 1037 ADD_BOOLEAN_BITFIELD(isRenderFlowThread, IsRenderFlowThread); 1038 ADD_BOOLEAN_BITFIELD(hasOutlineAutoAncestor, HasOutlineAutoAncestor); 1036 1039 1037 1040 // From RenderElement -
trunk/Source/WebCore/rendering/RenderOverflow.h
r159609 r196222 36 36 // could spill out of a line box. 37 37 38 // Examples of visual overflow are shadows, text stroke (and eventually outline andborder-image).38 // Examples of visual overflow are shadows, text stroke, outline (and eventually border-image). 39 39 40 40 // 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 153 153 { 154 154 ASSERT(isValid()); 155 156 155 if (shouldClipFlowThreadContent()) 157 156 return flowThreadPortionRect; 158 157 159 158 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();163 159 LayoutRect clipRect; 164 160 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(); 167 163 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()); 170 166 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); 171 167 } 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(); 174 170 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()); 177 173 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); 178 174 } 179 180 175 return clipRect; 181 176 } -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r194496 r196222 234 234 235 235 LayoutRect localRepaintRect = paintInfo.rect; 236 adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);237 236 if (adjustedPaintOffset.x() + visualOverflowRect().x() >= localRepaintRect.maxX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= localRepaintRect.x()) 238 237 return false; … … 615 614 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 616 615 r.move(view().layoutDelta()); 617 r.inflate(style().outlineSize());618 616 return computeRectForRepaint(r, repaintContainer); 619 617 } -
trunk/Source/WebCore/rendering/RenderTable.cpp
r194496 r196222 661 661 if (!isDocumentElementRenderer()) { 662 662 LayoutRect overflowBox = visualOverflowRect(); 663 adjustRectWithMaximumOutline(paintInfo.phase, overflowBox);664 663 flipForWritingMode(overflowBox); 665 664 overflowBox.moveBy(adjustedPaintOffset); -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r194496 r196222 384 384 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 385 385 r.move(view().layoutDelta()); 386 387 386 return computeRectForRepaint(r, repaintContainer); 388 387 } … … 1183 1182 1184 1183 LayoutRect localRepaintRect = paintInfo.rect; 1185 adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);1186 1187 1184 LayoutRect paintRect = LayoutRect(paintOffset + location(), frameRect().size()); 1188 1185 if (paintRect.y() - table()->outerBorderTop() >= localRepaintRect.maxY()) -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r194496 r196222 179 179 } 180 180 181 clearOverflow(); 182 addVisualEffectOverflow(); 181 183 // We only ever need to repaint if our cells didn't, which menas that they didn't need 182 184 // layout, so we know that our bounds didn't change. This code is just making up for … … 197 199 { 198 200 ASSERT(parent()); 199 200 201 // Rows and cells are in the same coordinate space. We need to both compute our overflow rect (which 201 202 // 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 538 538 rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing); 539 539 rowRenderer->updateLayerTransform(); 540 rowRenderer->clearOverflow(); 541 rowRenderer->addVisualEffectOverflow(); 540 542 } 541 543 … … 708 710 } 709 711 } 710 711 712 ASSERT(hasOverflowingCell == this->hasOverflowingCell()); 712 713 } … … 1231 1232 { 1232 1233 LayoutRect localRepaintRect = paintInfo.rect; 1233 adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);1234 1234 localRepaintRect.moveBy(-paintOffset); 1235 1235 -
trunk/Source/WebCore/rendering/RenderTheme.h
r194817 r196222 24 24 #define RenderTheme_h 25 25 26 #include "BorderData.h" 26 27 #include "ControlStates.h" 28 #include "FillLayer.h" 27 29 #if USE(NEW_THEME) 28 30 #include "Theme.h" … … 30 32 #include "ThemeTypes.h" 31 33 #endif 34 #include "PaintInfo.h" 32 35 #include "PopupMenuStyle.h" 33 36 #include "RenderObject.h" … … 164 167 virtual Color platformFocusRingColor() const { return Color(0, 0, 0); } 165 168 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); } 167 171 #if ENABLE(TOUCH_EVENTS) 168 172 static Color tapHighlightColor(); -
trunk/Source/WebCore/rendering/RenderView.cpp
r195591 r196222 826 826 } 827 827 828 // Compositing layer dimensions take outline size into account, so we have to recompute layer829 // 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 842 828 void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* end, int endPos, SelectionRepaintMode blockRepaintMode) 843 829 { -
trunk/Source/WebCore/rendering/RenderView.h
r194496 r196222 99 99 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override; 100 100 101 void setMaximalOutlineSize(float);102 float maximalOutlineSize() const { return m_maximalOutlineSize; }103 104 101 LayoutRect viewRect() const; 105 102 … … 351 348 // End deprecated members. 352 349 353 // Used to inflate compositing layers and repaint rects.354 float m_maximalOutlineSize { 0 };355 356 350 bool shouldUsePrintingLayout() const; 357 351 -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r196075 r196222 36 36 #include "QuotesData.h" 37 37 #include "RenderObject.h" 38 #include "RenderTheme.h" 38 39 #include "ScaleTransformOperation.h" 39 40 #include "ShadowData.h" … … 56 57 #if ENABLE(TEXT_AUTOSIZING) 57 58 #include "TextAutosizer.h" 58 #endif59 60 #if ENABLE(TOUCH_EVENTS)61 #include "RenderTheme.h"62 59 #endif 63 60 … … 481 478 } 482 479 480 if (hasOutlineInVisualOverflow() != other.hasOutlineInVisualOverflow()) 481 return true; 483 482 return false; 484 483 } … … 2027 2026 } 2028 2027 2028 float 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 2037 float 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 2029 2046 } // namespace WebCore -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r196075 r196222 668 668 669 669 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; } 677 672 EBorderStyle outlineStyle() const { return m_background->outline().style(); } 678 673 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); } 674 bool hasOutlineInVisualOverflow() const { return hasOutline() && outlineSize() > 0; } 679 675 680 676 EOverflow overflowX() const { return noninherited_flags.overflowX(); } … … 883 879 HangingPunctuation hangingPunctuation() const { return static_cast<HangingPunctuation>(rareInheritedData->m_hangingPunctuation); } 884 880 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; 892 882 const ShadowData* textShadow() const { return rareInheritedData->textShadow.get(); } 893 883 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.