Changeset 199516 in webkit
- Timestamp:
- Apr 13, 2016 3:11:46 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r199515 r199516 1 2016-04-13 Zalan Bujtas <zalan@apple.com> 2 3 Text on compositing layer with negative letter-spacing is truncated. 4 https://bugs.webkit.org/show_bug.cgi?id=156550 5 <rdar://problem/24212140> 6 7 Reviewed by Antti Koivisto. 8 9 Negative letter-spacing affects the right edge of content's visual overflow (for both RTL and LTR). 10 This is similar to how normal line layout adjusts it at InlineFlowBox::addTextBoxVisualOverflow(). 11 12 * fast/text/negative-letter-spacing-visual-overflow-expected.html: Added. 13 * fast/text/negative-letter-spacing-visual-overflow.html: Added. 14 1 15 2016-04-13 Eric Carlson <eric.carlson@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r199515 r199516 1 2016-04-13 Zalan Bujtas <zalan@apple.com> 2 3 Text on compositing layer with negative letter-spacing is truncated. 4 https://bugs.webkit.org/show_bug.cgi?id=156550 5 <rdar://problem/24212140> 6 7 Reviewed by Antti Koivisto. 8 9 Negative letter-spacing affects the right edge of content's visual overflow (for both RTL and LTR). 10 This is similar to how normal line layout adjusts it at InlineFlowBox::addTextBoxVisualOverflow(). 11 12 Test: fast/text/negative-letter-spacing-visual-overflow.html 13 14 * rendering/SimpleLineLayoutFunctions.cpp: 15 (WebCore::SimpleLineLayout::computeOverflow): 16 (WebCore::SimpleLineLayout::paintFlow): 17 (WebCore::SimpleLineLayout::collectFlowOverflow): 18 1 19 2016-04-13 Eric Carlson <eric.carlson@apple.com> 2 20 -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
r197987 r199516 66 66 } 67 67 68 static FloatRect computeOverflow(const RenderBlockFlow& flow, const FloatRect& layoutRect) 69 { 70 auto overflowRect = layoutRect; 71 auto strokeOverflow = std::ceil(flow.style().textStrokeWidth()); 72 overflowRect.inflate(strokeOverflow); 73 74 auto letterSpacing = flow.style().fontCascade().letterSpacing(); 75 if (letterSpacing >= 0) 76 return overflowRect; 77 // Last letter's negative spacing shrinks layout rect. Push it to visual overflow. 78 overflowRect.expand(-letterSpacing, 0); 79 return overflowRect; 80 } 81 68 82 void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& paintInfo, const LayoutPoint& paintOffset) 69 83 { … … 95 109 96 110 auto resolver = runResolver(flow, layout); 97 float strokeOverflow = std::ceil(flow.style().textStrokeWidth());98 111 float deviceScaleFactor = flow.document().deviceScaleFactor(); 99 112 for (auto run : resolver.rangeForRect(paintRect)) { … … 102 115 103 116 FloatRect rect = run.rect(); 104 FloatRect visualOverflowRect = rect; 105 visualOverflowRect.inflate(strokeOverflow); 117 FloatRect visualOverflowRect = computeOverflow(flow, rect); 106 118 if (paintRect.y() > visualOverflowRect.maxY() || paintRect.maxY() < visualOverflowRect.y()) 107 119 continue; … … 152 164 void collectFlowOverflow(RenderBlockFlow& flow, const Layout& layout) 153 165 { 154 float strokeOverflow = std::ceil(flow.style().textStrokeWidth()); 155 for (FloatRect lineRect : lineResolver(flow, layout)) { 156 LayoutRect inflatedLineRect(lineRect); 157 inflatedLineRect.inflate(strokeOverflow); 158 flow.addLayoutOverflow(inflatedLineRect); 159 flow.addVisualOverflow(inflatedLineRect); 166 for (auto lineRect : lineResolver(flow, layout)) { 167 LayoutRect visualOverflowRect = LayoutRect(computeOverflow(flow, lineRect)); 168 flow.addLayoutOverflow(LayoutRect(lineRect)); 169 flow.addVisualOverflow(visualOverflowRect); 160 170 } 161 171 }
Note: See TracChangeset
for help on using the changeset viewer.