Changeset 159345 in webkit
- Timestamp:
- Nov 15, 2013, 10:32:34 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r159344 r159345 1 2013-11-15 Antti Koivisto <antti@apple.com> 2 3 Hovering over text using simple line path should not cause switch to line boxes 4 https://bugs.webkit.org/show_bug.cgi?id=124418 5 6 Reviewed by Anders Carlsson. 7 8 * fast/text/simple-lines-hover-expected.html: Added. 9 * fast/text/simple-lines-hover.html: Added. 10 1 11 2013-11-15 Zoltan Horvath <zoltan@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r159337 r159345 1 2013-11-15 Antti Koivisto <antti@apple.com> 2 3 Hovering over text using simple line path should not cause switch to line boxes 4 https://bugs.webkit.org/show_bug.cgi?id=124418 5 6 Reviewed by Anders Carlsson. 7 8 Test: fast/text/simple-lines-hover.html 9 10 * rendering/RenderText.cpp: 11 (WebCore::RenderText::absoluteRects): 12 (WebCore::RenderText::absoluteQuadsClippedToEllipsis): 13 (WebCore::RenderText::absoluteQuads): 14 15 Collect quads and rects directly from simple lines without requiring the line box switch. 16 17 * rendering/SimpleLineLayoutFunctions.cpp: 18 (WebCore::SimpleLineLayout::collectTextAbsoluteRects): 19 (WebCore::SimpleLineLayout::collectTextAbsoluteQuads): 20 21 Add these. 22 23 * rendering/SimpleLineLayoutFunctions.h: 24 * rendering/SimpleLineLayoutResolver.h: 25 (WebCore::SimpleLineLayout::RunResolver::Run::start): 26 (WebCore::SimpleLineLayout::RunResolver::Run::end): 27 28 For future use. 29 1 30 2013-11-15 Radu Stavila <stavila@adobe.com> 2 31 -
trunk/Source/WebCore/rendering/RenderText.cpp
r159027 r159345 277 277 void RenderText::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const 278 278 { 279 // FIXME: These will go away when simple layout can do everything. 280 const_cast<RenderText&>(*this).ensureLineBoxes(); 281 279 if (auto layout = simpleLineLayout()) { 280 rects.appendVector(collectTextAbsoluteRects(*this, *layout, accumulatedOffset)); 281 return; 282 } 282 283 rects.appendVector(m_lineBoxes.absoluteRects(accumulatedOffset)); 283 284 } … … 302 303 Vector<FloatQuad> RenderText::absoluteQuadsClippedToEllipsis() const 303 304 { 304 const_cast<RenderText&>(*this).ensureLineBoxes(); 305 305 if (auto layout = simpleLineLayout()) { 306 ASSERT(style().textOverflow() != TextOverflowEllipsis); 307 return collectTextAbsoluteQuads(*this, *layout, nullptr); 308 } 306 309 return m_lineBoxes.absoluteQuads(*this, nullptr, RenderTextLineBoxes::ClipToEllipsis); 307 310 } … … 309 312 void RenderText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const 310 313 { 311 const_cast<RenderText&>(*this).ensureLineBoxes(); 312 314 if (auto layout = simpleLineLayout()) { 315 quads.appendVector(collectTextAbsoluteQuads(*this, *layout, wasFixed)); 316 return; 317 } 313 318 quads.appendVector(m_lineBoxes.absoluteQuads(*this, wasFixed, RenderTextLineBoxes::NoClipping)); 314 319 } -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
r159030 r159345 156 156 } 157 157 158 Vector<IntRect> collectTextAbsoluteRects(const RenderText& textRenderer, const Layout& layout, const LayoutPoint& accumulatedOffset) 159 { 160 Vector<IntRect> rects; 161 auto resolver = runResolver(toRenderBlockFlow(*textRenderer.parent()), layout); 162 for (auto it = resolver.begin(), end = resolver.end(); it != end; ++it) { 163 auto run = *it; 164 auto rect = run.rect(); 165 rects.append(enclosingIntRect(FloatRect(accumulatedOffset + rect.location(), rect.size()))); 166 } 167 return rects; 168 } 169 170 Vector<FloatQuad> collectTextAbsoluteQuads(const RenderText& textRenderer, const Layout& layout, bool* wasFixed) 171 { 172 Vector<FloatQuad> quads; 173 auto resolver = runResolver(toRenderBlockFlow(*textRenderer.parent()), layout); 174 for (auto it = resolver.begin(), end = resolver.end(); it != end; ++it) { 175 auto run = *it; 176 auto rect = run.rect(); 177 quads.append(textRenderer.localToAbsoluteQuad(FloatQuad(rect), 0, wasFixed)); 178 } 179 return quads; 180 } 181 158 182 } 159 183 } -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h
r159032 r159345 56 56 unsigned findTextCaretMaximumOffset(const RenderText&, const Layout&); 57 57 IntRect computeTextBoundingBox(const RenderText&, const Layout&); 58 59 Vector<IntRect> collectTextAbsoluteRects(const RenderText&, const Layout&, const LayoutPoint& accumulatedOffset); 60 Vector<FloatQuad> collectTextAbsoluteQuads(const RenderText&, const Layout&, bool* wasFixed); 58 61 59 62 LayoutUnit lineHeightFromFlow(const RenderBlockFlow&); -
trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.h
r159105 r159345 45 45 explicit Run(const Iterator&); 46 46 47 unsigned start() const; 48 unsigned end() const; 49 47 50 LayoutRect rect() const; 48 51 FloatPoint baseline() const; … … 126 129 } 127 130 131 inline unsigned RunResolver::Run::start() const 132 { 133 return m_iterator.simpleRun().start; 134 } 135 136 inline unsigned RunResolver::Run::end() const 137 { 138 return m_iterator.simpleRun().end; 139 } 140 128 141 inline LayoutRect RunResolver::Run::rect() const 129 142 {
Note:
See TracChangeset
for help on using the changeset viewer.