diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/rendering/SimpleLineLayoutFunctions.h | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/rendering/SimpleLineLayoutFunctions.h')
-rw-r--r-- | Source/WebCore/rendering/SimpleLineLayoutFunctions.h | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.h b/Source/WebCore/rendering/SimpleLineLayoutFunctions.h index 842bc7632..8444f2ffa 100644 --- a/Source/WebCore/rendering/SimpleLineLayoutFunctions.h +++ b/Source/WebCore/rendering/SimpleLineLayoutFunctions.h @@ -37,6 +37,7 @@ class HitTestLocation; class HitTestRequest; class HitTestResult; class RenderBlockFlow; +class RenderText; struct PaintInfo; namespace SimpleLineLayout { @@ -50,22 +51,17 @@ bool hitTestFlow(const RenderBlockFlow&, const Layout&, const HitTestRequest&, H void collectFlowOverflow(RenderBlockFlow&, const Layout&); bool isTextRendered(const RenderText&, const Layout&); -bool containsCaretOffset(const RenderObject&, const Layout&, unsigned); -unsigned findCaretMinimumOffset(const RenderObject&, const Layout&); -unsigned findCaretMaximumOffset(const RenderObject&, const Layout&); -IntRect computeBoundingBox(const RenderObject&, const Layout&); -IntPoint computeFirstRunLocation(const RenderObject&, const Layout&); +bool containsTextCaretOffset(const RenderText&, const Layout&, unsigned); +unsigned findTextCaretMinimumOffset(const RenderText&, const Layout&); +unsigned findTextCaretMaximumOffset(const RenderText&, const Layout&); +IntRect computeTextBoundingBox(const RenderText&, const Layout&); -Vector<IntRect> collectAbsoluteRects(const RenderObject&, const Layout&, const LayoutPoint& accumulatedOffset); -Vector<FloatQuad> collectAbsoluteQuads(const RenderObject&, const Layout&, bool* wasFixed); +Vector<IntRect> collectTextAbsoluteRects(const RenderText&, const Layout&, const LayoutPoint& accumulatedOffset); +Vector<FloatQuad> collectTextAbsoluteQuads(const RenderText&, const Layout&, bool* wasFixed); LayoutUnit lineHeightFromFlow(const RenderBlockFlow&); LayoutUnit baselineFromFlow(const RenderBlockFlow&); -#if ENABLE(TREE_DEBUGGING) -void showLineLayoutForFlow(const RenderBlockFlow&, const Layout&, int depth); -#endif - } namespace SimpleLineLayout { @@ -77,24 +73,24 @@ inline LayoutUnit computeFlowHeight(const RenderBlockFlow& flow, const Layout& l inline LayoutUnit computeFlowFirstLineBaseline(const RenderBlockFlow& flow, const Layout& layout) { - ASSERT_UNUSED(layout, layout.lineCount()); + ASSERT_UNUSED(layout, layout.runCount()); return flow.borderAndPaddingBefore() + baselineFromFlow(flow); } inline LayoutUnit computeFlowLastLineBaseline(const RenderBlockFlow& flow, const Layout& layout) { - ASSERT(layout.lineCount()); - return flow.borderAndPaddingBefore() + lineHeightFromFlow(flow) * (layout.lineCount() - 1) + baselineFromFlow(flow); + ASSERT(layout.runCount()); + return flow.borderAndPaddingBefore() + lineHeightFromFlow(flow) * (layout.runCount() - 1) + baselineFromFlow(flow); } -inline unsigned findCaretMinimumOffset(const RenderText&, const Layout& layout) +inline unsigned findTextCaretMinimumOffset(const RenderText&, const Layout& layout) { if (!layout.runCount()) return 0; return layout.runAt(0).start; } -inline unsigned findCaretMaximumOffset(const RenderText& renderer, const Layout& layout) +inline unsigned findTextCaretMaximumOffset(const RenderText& renderer, const Layout& layout) { if (!layout.runCount()) return renderer.textLength(); @@ -102,7 +98,7 @@ inline unsigned findCaretMaximumOffset(const RenderText& renderer, const Layout& return last.end; } -inline bool containsCaretOffset(const RenderText&, const Layout& layout, unsigned offset) +inline bool containsTextCaretOffset(const RenderText&, const Layout& layout, unsigned offset) { for (unsigned i = 0; i < layout.runCount(); ++i) { auto& run = layout.runAt(i); |