| Index: sky/engine/core/rendering/RenderParagraph.cpp
|
| diff --git a/sky/engine/core/rendering/RenderParagraph.cpp b/sky/engine/core/rendering/RenderParagraph.cpp
|
| index f8c9e0790df18417af24437c2d31c2d256a6ed53..202db7f0d6ce8accd8cb916fa4290af29d5db7c2 100644
|
| --- a/sky/engine/core/rendering/RenderParagraph.cpp
|
| +++ b/sky/engine/core/rendering/RenderParagraph.cpp
|
| @@ -5,6 +5,8 @@
|
| #include "sky/engine/config.h"
|
| #include "sky/engine/core/rendering/RenderParagraph.h"
|
|
|
| +#include "sky/engine/core/rendering/InlineIterator.h"
|
| +
|
| namespace blink {
|
|
|
| RenderParagraph::RenderParagraph(ContainerNode* node)
|
| @@ -23,4 +25,52 @@ RenderParagraph* RenderParagraph::createAnonymous(Document& document)
|
| return renderer;
|
| }
|
|
|
| +void RenderParagraph::addOverflowFromChildren()
|
| +{
|
| + LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : LayoutUnit();
|
| + // FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to.
|
| + if (hasOverflowClip() && !endPadding && node() && node()->isRootEditableElement() && style()->isLeftToRightDirection())
|
| + endPadding = 1;
|
| + for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
|
| + addLayoutOverflow(curr->paddedLayoutOverflowRect(endPadding));
|
| + LayoutRect visualOverflow = curr->visualOverflowRect(curr->lineTop(), curr->lineBottom());
|
| + addContentsVisualOverflow(visualOverflow);
|
| + }
|
| +}
|
| +
|
| +void RenderParagraph::simplifiedNormalFlowLayout()
|
| +{
|
| + ListHashSet<RootInlineBox*> lineBoxes;
|
| + for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) {
|
| + RenderObject* o = walker.current();
|
| + if (!o->isOutOfFlowPositioned() && o->isReplaced()) {
|
| + o->layoutIfNeeded();
|
| + if (toRenderBox(o)->inlineBoxWrapper()) {
|
| + RootInlineBox& box = toRenderBox(o)->inlineBoxWrapper()->root();
|
| + lineBoxes.add(&box);
|
| + }
|
| + } else if (o->isText() || (o->isRenderInline() && !walker.atEndOfInline())) {
|
| + o->clearNeedsLayout();
|
| + }
|
| + }
|
| +
|
| + // FIXME: Glyph overflow will get lost in this case, but not really a big deal.
|
| + GlyphOverflowAndFallbackFontsMap textBoxDataMap;
|
| + for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); it != lineBoxes.end(); ++it) {
|
| + RootInlineBox* box = *it;
|
| + box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap);
|
| + }
|
| +}
|
| +
|
| +void RenderParagraph::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| +{
|
| + m_lineBoxes.paint(this, paintInfo, paintOffset);
|
| +}
|
| +
|
| +bool RenderParagraph::hitTestContents(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
|
| +{
|
| + return m_lineBoxes.hitTest(this, request, result, locationInContainer, accumulatedOffset, hitTestAction);
|
| +}
|
| +
|
| +
|
| } // namespace blink
|
|
|