WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
with shouted OVERRIDE for qt bots
br-non-text-12.patch (text/plain), 79.49 KB, created by
Antti Koivisto
on 2013-09-17 07:05:36 PDT
(
hide
)
Description:
with shouted OVERRIDE for qt bots
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2013-09-17 07:05:36 PDT
Size:
79.49 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 155950) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,129 @@ >+2013-09-17 Antti Koivisto <antti@apple.com> >+ >+ RenderBR should not be RenderText >+ https://bugs.webkit.org/show_bug.cgi?id=121221 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Stop inhering RenderBR from RenderText and make it be a RenderBoxModelObject instead. RenderBR was one >+ of the few cases where Element renderer was a RenderText. This will enable future cleanups. >+ >+ RenderBR used little of RenderText mechanisms and was already heavily specialized everywhere. Layout code >+ didn't care about its text content at all. The new RenderText is also significatly more lightweight >+ that the old. As a line box it uses plain InlineBox instead of InlineTextBox. >+ >+ The patch tries to avoid changing test results though there are a few changed render tree dumps without >+ visual effect. There are also two rendering progressions. >+ >+ * accessibility/AccessibilityRenderObject.cpp: >+ (WebCore::AccessibilityRenderObject::textUnderElement): >+ (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): >+ * dom/ContainerNode.cpp: >+ (WebCore::ContainerNode::getUpperLeftCorner): >+ * dom/Document.cpp: >+ (WebCore::Document::updateHoverActiveState): >+ * dom/Position.cpp: >+ (WebCore::hasInlineBoxWrapper): >+ (WebCore::nextRenderedEditable): >+ (WebCore::previousRenderedEditable): >+ (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight): >+ (WebCore::Position::getInlineBoxAndOffset): >+ * dom/Range.cpp: >+ (WebCore::Range::textRects): >+ (WebCore::Range::textQuads): >+ * editing/ApplyStyleCommand.cpp: >+ (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): >+ * editing/Editor.cpp: >+ (WebCore::findFirstMarkable): >+ * editing/TextIterator.cpp: >+ (WebCore::ignoresContainerClip): >+ * editing/VisibleUnits.cpp: >+ (WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox): >+ (WebCore::CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox): >+ (WebCore::logicallyPreviousBox): >+ (WebCore::logicallyNextBox): >+ (WebCore::wordBreakIteratorForMinOffsetBoundary): >+ (WebCore::wordBreakIteratorForMaxOffsetBoundary): >+ * rendering/InlineBox.cpp: >+ (WebCore::InlineBox::logicalHeight): >+ (WebCore::InlineBox::baselinePosition): >+ (WebCore::InlineBox::lineHeight): >+ (WebCore::InlineBox::deleteLine): >+ (WebCore::InlineBox::extractLine): >+ (WebCore::InlineBox::attachLine): >+ (WebCore::InlineBox::paint): >+ * rendering/InlineBox.h: >+ (WebCore::InlineBox::isLineBreak): >+ * rendering/InlineFlowBox.cpp: >+ (WebCore::InlineFlowBox::computeOverflow): >+ * rendering/InlineIterator.h: >+ (WebCore::isIteratorTarget): >+ * rendering/InlineTextBox.cpp: >+ (WebCore::InlineTextBox::lineHeight): >+ (WebCore::InlineTextBox::isLineBreak): >+ * rendering/RenderBR.cpp: >+ (WebCore::RenderBR::RenderBR): >+ (WebCore::RenderBR::~RenderBR): >+ (WebCore::RenderBR::createAnonymous): >+ (WebCore::RenderBR::lineHeight): >+ (WebCore::RenderBR::baselinePosition): >+ (WebCore::RenderBR::createInlineBox): >+ (WebCore::RenderBR::setInlineBoxWrapper): >+ (WebCore::RenderBR::replaceInlineBoxWrapper): >+ (WebCore::RenderBR::deleteInlineBoxWrapper): >+ (WebCore::RenderBR::dirtyLineBoxes): >+ (WebCore::RenderBR::caretMinOffset): >+ (WebCore::RenderBR::caretMaxOffset): >+ (WebCore::RenderBR::canBeSelectionLeaf): >+ (WebCore::RenderBR::setSelectionState): >+ (WebCore::RenderBR::localCaretRect): >+ (WebCore::RenderBR::linesBoundingBox): >+ (WebCore::RenderBR::absoluteRects): >+ (WebCore::RenderBR::absoluteQuads): >+ (WebCore::RenderBR::updateFromStyle): >+ (WebCore::RenderBR::borderBoundingBox): >+ * rendering/RenderBR.h: >+ (WebCore::toRenderBR): >+ * rendering/RenderBlock.cpp: >+ (WebCore::InlineMinMaxIterator::next): >+ (WebCore::RenderBlock::updateFirstLetter): >+ * rendering/RenderBlockLineLayout.cpp: >+ (WebCore::createInlineBoxForRenderer): >+ (WebCore::dirtyLineBoxesForRenderer): >+ (WebCore::reachedEndOfTextRenderer): >+ (WebCore::RenderBlock::computeBlockDirectionPositionsForLine): >+ (WebCore::RenderBlockFlow::layoutInlineChildren): >+ (WebCore::requiresLineBox): >+ (WebCore::shouldSkipWhitespaceAfterStartObject): >+ (WebCore::canBreakAtThisPosition): >+ * rendering/RenderInline.cpp: >+ (WebCore::RenderInline::generateCulledLineBoxRects): >+ (WebCore::RenderInline::culledInlineFirstLineBox): >+ (WebCore::RenderInline::culledInlineLastLineBox): >+ (WebCore::RenderInline::dirtyLineBoxes): >+ * rendering/RenderLineBoxList.cpp: >+ (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): >+ * rendering/RenderMenuList.cpp: >+ (WebCore::RenderMenuList::RenderMenuList): >+ (WebCore::RenderMenuList::styleDidChange): >+ (WebCore::RenderMenuList::setText): >+ (WebCore::RenderMenuList::text): >+ * rendering/RenderMenuList.h: >+ * rendering/RenderObject.h: >+ (WebCore::RenderObject::isBeforeContent): >+ (WebCore::RenderObject::isAfterContent): >+ * rendering/RenderObjectChildList.cpp: >+ (WebCore::RenderObjectChildList::removeChildNode): >+ * rendering/RenderText.cpp: >+ (WebCore::RenderText::removeAndDestroyTextBoxes): >+ (WebCore::RenderText::computePreferredLogicalWidths): >+ (WebCore::RenderText::setTextInternal): >+ * rendering/RenderTreeAsText.cpp: >+ (WebCore::RenderTreeAsText::writeRenderObject): >+ * rendering/RootInlineBox.cpp: >+ (WebCore::RootInlineBox::ascentAndDescentForBox): >+ (WebCore::RootInlineBox::verticalPositionForBox): >+ > 2013-09-17 Antti Koivisto <antti@apple.com> > > Move text caret rect computation to root inline box >Index: Source/WebCore/accessibility/AccessibilityRenderObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityRenderObject.cpp (revision 155948) >+++ Source/WebCore/accessibility/AccessibilityRenderObject.cpp (working copy) >@@ -633,7 +633,7 @@ String AccessibilityRenderObject::textUn > > // Reflect when a content author has explicitly marked a line break. > if (m_renderer->isBR()) >- return toRenderBR(*m_renderer).text(); >+ return ASCIILiteral("\n"); > > #if ENABLE(MATHML) > // Math operators create RenderText nodes on the fly that are not tied into the DOM in a reasonable way, >@@ -1154,15 +1154,17 @@ bool AccessibilityRenderObject::computeA > AccessibilityObject* controlObject = correspondingControlForLabelElement(); > if (controlObject && !controlObject->exposesTitleUIElement() && controlObject->isCheckboxOrRadio()) > return true; >- >- // NOTE: BRs always have text boxes now, so the text box check here can be removed >+ >+ if (m_renderer->isBR()) >+ return true; >+ > if (m_renderer->isText()) { > // static text beneath MenuItems and MenuButtons are just reported along with the menu item, so it's ignored on an individual level > AccessibilityObject* parent = parentObjectUnignored(); > if (parent && (parent->isMenuItem() || parent->ariaRoleAttribute() == MenuButtonRole)) > return true; > RenderText* renderText = toRenderText(m_renderer); >- if (m_renderer->isBR() || !renderText->firstTextBox()) >+ if (!renderText->firstTextBox()) > return true; > > // static text beneath TextControls is reported along with the text control text so it's ignored. >Index: Source/WebCore/dom/ContainerNode.cpp >=================================================================== >--- Source/WebCore/dom/ContainerNode.cpp (revision 155948) >+++ Source/WebCore/dom/ContainerNode.cpp (working copy) >@@ -913,9 +913,9 @@ bool ContainerNode::getUpperLeftCorner(F > return true; > } > >- if (p->node() && p->node() == this && o->isText() && !o->isBR() && !toRenderText(o)->firstTextBox()) { >+ if (p->node() && p->node() == this && o->isText() && !toRenderText(o)->firstTextBox()) { > // do nothing - skip unrendered whitespace that is a child or next sibling of the anchor >- } else if ((o->isText() && !o->isBR()) || o->isReplaced()) { >+ } else if (o->isText() || o->isReplaced()) { > point = FloatPoint(); > if (o->isText() && toRenderText(o)->firstTextBox()) { > point.move(toRenderText(o)->linesBoundingBox().x(), toRenderText(o)->firstTextBox()->root().lineTop()); >Index: Source/WebCore/dom/Document.cpp >=================================================================== >--- Source/WebCore/dom/Document.cpp (revision 155948) >+++ Source/WebCore/dom/Document.cpp (working copy) >@@ -5826,7 +5826,7 @@ void Document::updateHoverActiveState(co > // We are setting the :active chain and freezing it. If future moves happen, they > // will need to reference this chain. > for (RenderObject* curr = newActiveElement->renderer(); curr; curr = curr->parent()) { >- if (!curr->node() || !curr->node()->isElementNode() || curr->isText()) >+ if (!curr->node() || !curr->node()->isElementNode() || curr->isText() || curr->isBR()) > continue; > m_userActionElements.setInActiveChain(toElement(curr->node()), true); > } >Index: Source/WebCore/dom/Position.cpp >=================================================================== >--- Source/WebCore/dom/Position.cpp (revision 155948) >+++ Source/WebCore/dom/Position.cpp (working copy) >@@ -33,6 +33,7 @@ > #include "InlineTextBox.h" > #include "Logging.h" > #include "PositionIterator.h" >+#include "RenderBR.h" > #include "RenderBlock.h" > #include "RenderInline.h" > #include "RenderText.h" >@@ -50,6 +51,17 @@ namespace WebCore { > > using namespace HTMLNames; > >+static bool hasInlineBoxWrapper(RenderObject& renderer) >+{ >+ if (renderer.isBox() && toRenderBox(renderer).inlineBoxWrapper()) >+ return true; >+ if (renderer.isText() && toRenderText(renderer).firstTextBox()) >+ return true; >+ if (renderer.isBR() && toRenderBR(renderer).inlineBoxWrapper()) >+ return true; >+ return false; >+} >+ > static Node* nextRenderedEditable(Node* node) > { > while ((node = nextLeafNode(node))) { >@@ -58,7 +70,7 @@ static Node* nextRenderedEditable(Node* > RenderObject* renderer = node->renderer(); > if (!renderer) > continue; >- if ((renderer->isBox() && toRenderBox(renderer)->inlineBoxWrapper()) || (renderer->isText() && toRenderText(renderer)->firstTextBox())) >+ if (hasInlineBoxWrapper(*renderer)) > return node; > } > return 0; >@@ -72,7 +84,7 @@ static Node* previousRenderedEditable(No > RenderObject* renderer = node->renderer(); > if (!renderer) > continue; >- if ((renderer->isBox() && toRenderBox(renderer)->inlineBoxWrapper()) || (renderer->isText() && toRenderText(renderer)->firstTextBox())) >+ if (hasInlineBoxWrapper(*renderer)) > return node; > } > return 0; >@@ -845,6 +857,7 @@ bool Position::hasRenderedNonAnonymousDe > for (RenderObject *o = renderer->firstChild(); o && o != stop; o = o->nextInPreOrder()) > if (o->nonPseudoNode()) { > if ((o->isText() && boundingBoxLogicalHeight(o, toRenderText(o)->linesBoundingBox())) >+ || (o->isBR() && boundingBoxLogicalHeight(o, toRenderBR(o)->linesBoundingBox())) > || (o->isBox() && toRenderBox(o)->pixelSnappedLogicalHeight()) > || (o->isRenderInline() && isEmptyInline(o) && boundingBoxLogicalHeight(o, toRenderInline(o)->linesBoundingBox()))) > return true; >@@ -1181,28 +1194,9 @@ void Position::getInlineBoxAndOffset(EAf > caretOffset = deprecatedEditingOffset(); > RenderObject* renderer = deprecatedNode()->renderer(); > >- if (!renderer->isText()) { >- inlineBox = 0; >- if (canHaveChildrenForEditing(deprecatedNode()) && renderer->isRenderBlockFlow() && hasRenderedNonAnonymousDescendantsWithHeight(renderer)) { >- // Try a visually equivalent position with possibly opposite editability. This helps in case |this| is in >- // an editable block but surrounded by non-editable positions. It acts to negate the logic at the beginning >- // of RenderObject::createVisiblePosition(). >- Position equivalent = downstreamIgnoringEditingBoundaries(*this); >- if (equivalent == *this) { >- equivalent = upstreamIgnoringEditingBoundaries(*this); >- if (equivalent == *this || downstreamIgnoringEditingBoundaries(equivalent) == *this) >- return; >- } >- >- equivalent.getInlineBoxAndOffset(UPSTREAM, primaryDirection, inlineBox, caretOffset); >- return; >- } >- if (renderer->isBox()) { >- inlineBox = toRenderBox(renderer)->inlineBoxWrapper(); >- if (!inlineBox || (caretOffset > inlineBox->caretMinOffset() && caretOffset < inlineBox->caretMaxOffset())) >- return; >- } >- } else { >+ if (renderer->isBR()) >+ inlineBox = !caretOffset ? toRenderBR(renderer)->inlineBoxWrapper() : nullptr; >+ else if (renderer->isText()) { > RenderText* textRenderer = toRenderText(renderer); > > InlineTextBox* box; >@@ -1233,6 +1227,27 @@ void Position::getInlineBoxAndOffset(EAf > caretOffset = box->caretMinOffset(); > } > inlineBox = box ? box : candidate; >+ } else { >+ inlineBox = 0; >+ if (canHaveChildrenForEditing(deprecatedNode()) && renderer->isRenderBlockFlow() && hasRenderedNonAnonymousDescendantsWithHeight(renderer)) { >+ // Try a visually equivalent position with possibly opposite editability. This helps in case |this| is in >+ // an editable block but surrounded by non-editable positions. It acts to negate the logic at the beginning >+ // of RenderObject::createVisiblePosition(). >+ Position equivalent = downstreamIgnoringEditingBoundaries(*this); >+ if (equivalent == *this) { >+ equivalent = upstreamIgnoringEditingBoundaries(*this); >+ if (equivalent == *this || downstreamIgnoringEditingBoundaries(equivalent) == *this) >+ return; >+ } >+ >+ equivalent.getInlineBoxAndOffset(UPSTREAM, primaryDirection, inlineBox, caretOffset); >+ return; >+ } >+ if (renderer->isBox()) { >+ inlineBox = toRenderBox(renderer)->inlineBoxWrapper(); >+ if (!inlineBox || (caretOffset > inlineBox->caretMinOffset() && caretOffset < inlineBox->caretMaxOffset())) >+ return; >+ } > } > > if (!inlineBox) >Index: Source/WebCore/dom/Range.cpp >=================================================================== >--- Source/WebCore/dom/Range.cpp (revision 155948) >+++ Source/WebCore/dom/Range.cpp (working copy) >@@ -1607,13 +1607,17 @@ void Range::textRects(Vector<IntRect>& r > Node* stopNode = pastLastNode(); > for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) { > RenderObject* r = node->renderer(); >- if (!r || !r->isText()) >+ if (!r) > continue; >- RenderText* renderText = toRenderText(r); >- int startOffset = node == startContainer ? m_start.offset() : 0; >- int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max(); > bool isFixed = false; >- renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSelectionHeight, &isFixed); >+ if (r->isBR()) >+ r->absoluteRects(rects, flooredLayoutPoint(r->localToAbsolute())); >+ else if (r->isText()) { >+ int startOffset = node == startContainer ? m_start.offset() : 0; >+ int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max(); >+ toRenderText(r)->absoluteRectsForRange(rects, startOffset, endOffset, useSelectionHeight, &isFixed); >+ } else >+ continue; > allFixed &= isFixed; > someFixed |= isFixed; > } >@@ -1639,13 +1643,17 @@ void Range::textQuads(Vector<FloatQuad>& > Node* stopNode = pastLastNode(); > for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) { > RenderObject* r = node->renderer(); >- if (!r || !r->isText()) >+ if (!r) > continue; >- RenderText* renderText = toRenderText(r); >- int startOffset = node == startContainer ? m_start.offset() : 0; >- int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max(); > bool isFixed = false; >- renderText->absoluteQuadsForRange(quads, startOffset, endOffset, useSelectionHeight, &isFixed); >+ if (r->isBR()) { >+ r->absoluteQuads(quads, &isFixed); >+ } else if (r->isText()) { >+ int startOffset = node == startContainer ? m_start.offset() : 0; >+ int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max(); >+ toRenderText(r)->absoluteQuadsForRange(quads, startOffset, endOffset, useSelectionHeight, &isFixed); >+ } else >+ continue; > allFixed &= isFixed; > someFixed |= isFixed; > } >Index: Source/WebCore/editing/ApplyStyleCommand.cpp >=================================================================== >--- Source/WebCore/editing/ApplyStyleCommand.cpp (revision 155948) >+++ Source/WebCore/editing/ApplyStyleCommand.cpp (working copy) >@@ -1020,6 +1020,8 @@ void ApplyStyleCommand::applyInlineStyle > > if (node->renderer()->isText() && static_cast<RenderText*>(node->renderer())->isAllCollapsibleWhitespace()) > return; >+ if (node->renderer()->isBR() && !node->renderer()->style()->preserveNewline()) >+ return; > > // We can't wrap node with the styled element here because new styled element will never be removed if we did. > // If we modified the child pointer in pushDownInlineStyleAroundNode to point to new style element >Index: Source/WebCore/editing/Editor.cpp >=================================================================== >--- Source/WebCore/editing/Editor.cpp (revision 155948) >+++ Source/WebCore/editing/Editor.cpp (working copy) >@@ -3085,7 +3085,7 @@ static Node* findFirstMarkable(Node* nod > while (node) { > if (!node->renderer()) > return 0; >- if (node->renderer()->isText()) >+ if (node->renderer()->isText() || node->renderer()->isBR()) > return node; > if (isHTMLTextFormControlElement(node)) > node = toHTMLTextFormControlElement(node)->visiblePositionForIndex(1).deepEquivalent().deprecatedNode(); >Index: Source/WebCore/editing/TextIterator.cpp >=================================================================== >--- Source/WebCore/editing/TextIterator.cpp (revision 155948) >+++ Source/WebCore/editing/TextIterator.cpp (working copy) >@@ -215,7 +215,7 @@ static inline bool fullyClipsContents(No > static inline bool ignoresContainerClip(Node* node) > { > RenderObject* renderer = node->renderer(); >- if (!renderer || renderer->isText()) >+ if (!renderer || renderer->isText() || renderer->isBR()) > return false; > return renderer->style()->hasOutOfFlowPosition(); > } >Index: Source/WebCore/editing/VisibleUnits.cpp >=================================================================== >--- Source/WebCore/editing/VisibleUnits.cpp (revision 155948) >+++ Source/WebCore/editing/VisibleUnits.cpp (working copy) >@@ -124,8 +124,8 @@ class CachedLogicallyOrderedLeafBoxes { > public: > CachedLogicallyOrderedLeafBoxes(); > >- const InlineTextBox* previousTextBox(const RootInlineBox*, const InlineTextBox*); >- const InlineTextBox* nextTextBox(const RootInlineBox*, const InlineTextBox*); >+ const InlineBox* previousTextOrLineBreakBox(const RootInlineBox*, const InlineTextBox*); >+ const InlineBox* nextTextOrLineBreakBox(const RootInlineBox*, const InlineTextBox*); > > size_t size() const { return m_leafBoxes.size(); } > const InlineBox* firstBox() const { return m_leafBoxes[0]; } >@@ -140,7 +140,7 @@ private: > > CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes() : m_rootInlineBox(0) { }; > >-const InlineTextBox* CachedLogicallyOrderedLeafBoxes::previousTextBox(const RootInlineBox* root, const InlineTextBox* box) >+const InlineBox* CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox(const RootInlineBox* root, const InlineTextBox* box) > { > if (!root) > return 0; >@@ -153,14 +153,15 @@ const InlineTextBox* CachedLogicallyOrde > boxIndex = boxIndexInLeaves(box) - 1; > > for (int i = boxIndex; i >= 0; --i) { >- if (m_leafBoxes[i]->isInlineTextBox()) >- return toInlineTextBox(m_leafBoxes[i]); >+ InlineBox* box = m_leafBoxes[i]; >+ if (box->isInlineTextBox() || box->renderer().isBR()) >+ return box; > } > > return 0; > } > >-const InlineTextBox* CachedLogicallyOrderedLeafBoxes::nextTextBox(const RootInlineBox* root, const InlineTextBox* box) >+const InlineBox* CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox(const RootInlineBox* root, const InlineTextBox* box) > { > if (!root) > return 0; >@@ -174,8 +175,9 @@ const InlineTextBox* CachedLogicallyOrde > nextBoxIndex = boxIndexInLeaves(box) + 1; > > for (size_t i = nextBoxIndex; i < m_leafBoxes.size(); ++i) { >- if (m_leafBoxes[i]->isInlineTextBox()) >- return toInlineTextBox(m_leafBoxes[i]); >+ InlineBox* box = m_leafBoxes[i]; >+ if (box->isInlineTextBox() || box->renderer().isBR()) >+ return box; > } > > return 0; >@@ -200,16 +202,16 @@ int CachedLogicallyOrderedLeafBoxes::box > return 0; > } > >-static const InlineTextBox* logicallyPreviousBox(const VisiblePosition& visiblePosition, const InlineTextBox* textBox, >+static const InlineBox* logicallyPreviousBox(const VisiblePosition& visiblePosition, const InlineTextBox* textBox, > bool& previousBoxInDifferentBlock, CachedLogicallyOrderedLeafBoxes& leafBoxes) > { > const InlineBox* startBox = textBox; > >- const InlineTextBox* previousBox = leafBoxes.previousTextBox(&startBox->root(), textBox); >+ const InlineBox* previousBox = leafBoxes.previousTextOrLineBreakBox(&startBox->root(), textBox); > if (previousBox) > return previousBox; > >- previousBox = leafBoxes.previousTextBox(startBox->root().prevRootBox(), 0); >+ previousBox = leafBoxes.previousTextOrLineBreakBox(startBox->root().prevRootBox(), 0); > if (previousBox) > return previousBox; > >@@ -227,7 +229,7 @@ static const InlineTextBox* logicallyPre > if (!previousRoot) > break; > >- previousBox = leafBoxes.previousTextBox(previousRoot, 0); >+ previousBox = leafBoxes.previousTextOrLineBreakBox(previousRoot, 0); > if (previousBox) { > previousBoxInDifferentBlock = true; > return previousBox; >@@ -241,16 +243,16 @@ static const InlineTextBox* logicallyPre > } > > >-static const InlineTextBox* logicallyNextBox(const VisiblePosition& visiblePosition, const InlineTextBox* textBox, >+static const InlineBox* logicallyNextBox(const VisiblePosition& visiblePosition, const InlineTextBox* textBox, > bool& nextBoxInDifferentBlock, CachedLogicallyOrderedLeafBoxes& leafBoxes) > { > const InlineBox* startBox = textBox; > >- const InlineTextBox* nextBox = leafBoxes.nextTextBox(&startBox->root(), textBox); >+ const InlineBox* nextBox = leafBoxes.nextTextOrLineBreakBox(&startBox->root(), textBox); > if (nextBox) > return nextBox; > >- nextBox = leafBoxes.nextTextBox(startBox->root().nextRootBox(), 0); >+ nextBox = leafBoxes.nextTextOrLineBreakBox(startBox->root().nextRootBox(), 0); > if (nextBox) > return nextBox; > >@@ -268,7 +270,7 @@ static const InlineTextBox* logicallyNex > if (!nextRoot) > break; > >- nextBox = leafBoxes.nextTextBox(nextRoot, 0); >+ nextBox = leafBoxes.nextTextOrLineBreakBox(nextRoot, 0); > if (nextBox) { > nextBoxInDifferentBlock = true; > return nextBox; >@@ -287,13 +289,14 @@ static TextBreakIterator* wordBreakItera > previousBoxInDifferentBlock = false; > > // FIXME: Handle the case when we don't have an inline text box. >- const InlineTextBox* previousBox = logicallyPreviousBox(visiblePosition, textBox, previousBoxInDifferentBlock, leafBoxes); >+ const InlineBox* previousBox = logicallyPreviousBox(visiblePosition, textBox, previousBoxInDifferentBlock, leafBoxes); > > int len = 0; > string.clear(); >- if (previousBox) { >- previousBoxLength = previousBox->len(); >- string.append(previousBox->textRenderer().text()->characters() + previousBox->start(), previousBoxLength); >+ if (previousBox && previousBox->isInlineTextBox()) { >+ const InlineTextBox* previousTextBox = toInlineTextBox(previousBox); >+ previousBoxLength = previousTextBox->len(); >+ string.append(previousTextBox->textRenderer().text()->characters() + previousTextBox->start(), previousBoxLength); > len += previousBoxLength; > } > string.append(textBox->textRenderer().text()->characters() + textBox->start(), textBox->len()); >@@ -308,15 +311,16 @@ static TextBreakIterator* wordBreakItera > nextBoxInDifferentBlock = false; > > // FIXME: Handle the case when we don't have an inline text box. >- const InlineTextBox* nextBox = logicallyNextBox(visiblePosition, textBox, nextBoxInDifferentBlock, leafBoxes); >+ const InlineBox* nextBox = logicallyNextBox(visiblePosition, textBox, nextBoxInDifferentBlock, leafBoxes); > > int len = 0; > string.clear(); > string.append(textBox->textRenderer().text()->characters() + textBox->start(), textBox->len()); > len += textBox->len(); >- if (nextBox) { >- string.append(nextBox->textRenderer().text()->characters() + nextBox->start(), nextBox->len()); >- len += nextBox->len(); >+ if (nextBox && nextBox->isInlineTextBox()) { >+ const InlineTextBox* nextTextBox = toInlineTextBox(nextBox); >+ string.append(nextTextBox->textRenderer().text()->characters() + nextTextBox->start(), nextTextBox->len()); >+ len += nextTextBox->len(); > } > > return wordBreakIterator(string.data(), len); >Index: Source/WebCore/rendering/InlineBox.cpp >=================================================================== >--- Source/WebCore/rendering/InlineBox.cpp (revision 155948) >+++ Source/WebCore/rendering/InlineBox.cpp (working copy) >@@ -27,6 +27,7 @@ > #include "Page.h" > #include "PaintInfo.h" > #include "RenderArena.h" >+#include "RenderBR.h" > #include "RenderBlock.h" > #include "RootInlineBox.h" > >@@ -140,7 +141,7 @@ float InlineBox::logicalHeight() const > if (hasVirtualLogicalHeight()) > return virtualLogicalHeight(); > >- if (renderer().isText()) >+ if (renderer().isText() || renderer().isBR()) > return m_bitfields.isText() ? renderer().style(isFirstLineStyle())->fontMetrics().height() : 0; > if (renderer().isBox() && parent()) > return isHorizontal() ? toRenderBox(renderer()).height() : toRenderBox(renderer()).width(); >@@ -156,11 +157,15 @@ float InlineBox::logicalHeight() const > > int InlineBox::baselinePosition(FontBaseline baselineType) const > { >+ if (renderer().isBR() && !isText()) >+ return 0; > return boxModelObject()->baselinePosition(baselineType, m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); > } > > LayoutUnit InlineBox::lineHeight() const > { >+ if (renderer().isBR() && !isText()) >+ return 0; > return boxModelObject()->lineHeight(m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); > } > >@@ -183,8 +188,12 @@ void InlineBox::dirtyLineBoxes() > > void InlineBox::deleteLine(RenderArena& arena) > { >- if (!m_bitfields.extracted() && m_renderer.isBox()) >- toRenderBox(renderer()).setInlineBoxWrapper(0); >+ if (!m_bitfields.extracted()) { >+ if (m_renderer.isBox()) >+ toRenderBox(renderer()).setInlineBoxWrapper(0); >+ else if (renderer().isBR()) >+ toRenderBR(renderer()).setInlineBoxWrapper(0); >+ } > destroy(arena); > } > >@@ -193,6 +202,8 @@ void InlineBox::extractLine() > m_bitfields.setExtracted(true); > if (m_renderer.isBox()) > toRenderBox(renderer()).setInlineBoxWrapper(0); >+ else if (renderer().isBR()) >+ toRenderBR(renderer()).setInlineBoxWrapper(0); > } > > void InlineBox::attachLine() >@@ -200,6 +211,8 @@ void InlineBox::attachLine() > m_bitfields.setExtracted(false); > if (m_renderer.isBox()) > toRenderBox(renderer()).setInlineBoxWrapper(this); >+ else if (renderer().isBR()) >+ toRenderBR(renderer()).setInlineBoxWrapper(this); > } > > void InlineBox::adjustPosition(float dx, float dy) >@@ -216,7 +229,7 @@ void InlineBox::paint(PaintInfo& paintIn > return; > > LayoutPoint childPoint = paintOffset; >- if (parent()->renderer().style()->isFlippedBlocksWritingMode()) // Faster than calling containingBlock(). >+ if (parent()->renderer().style()->isFlippedBlocksWritingMode() && renderer().isBox()) // Faster than calling containingBlock(). > childPoint = m_renderer.containingBlock()->flipForWritingModeForChild(&toRenderBox(renderer()), childPoint); > > // Paint all phases of replaced elements atomically, as though the replaced element established its >Index: Source/WebCore/rendering/InlineBox.h >=================================================================== >--- Source/WebCore/rendering/InlineBox.h (revision 155948) >+++ Source/WebCore/rendering/InlineBox.h (working copy) >@@ -69,7 +69,7 @@ public: > virtual void extractLine(); > virtual void attachLine(); > >- virtual bool isLineBreak() const { return false; } >+ virtual bool isLineBreak() const { return renderer().isBR(); } > > virtual void adjustPosition(float dx, float dy); > void adjustLogicalPosition(float deltaLogicalLeft, float deltaLogicalTop) >Index: Source/WebCore/rendering/InlineFlowBox.cpp >=================================================================== >--- Source/WebCore/rendering/InlineFlowBox.cpp (revision 155948) >+++ Source/WebCore/rendering/InlineFlowBox.cpp (working copy) >@@ -949,15 +949,15 @@ void InlineFlowBox::computeOverflow(Layo > for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { > if (curr->renderer().isOutOfFlowPositioned()) > continue; // Positioned placeholders don't affect calculations. >- >+ >+ if (curr->renderer().isBR()) >+ continue; > if (curr->renderer().isText()) { > InlineTextBox* text = toInlineTextBox(curr); >- if (text->renderer().isBR()) >- continue; > LayoutRect textBoxOverflow(enclosingLayoutRect(text->logicalFrameRect())); > addTextBoxVisualOverflow(text, textBoxDataMap, textBoxOverflow); > logicalVisualOverflow.unite(textBoxOverflow); >- } else if (curr->renderer().isRenderInline()) { >+ } else if (curr->renderer().isRenderInline()) { > InlineFlowBox* flow = toInlineFlowBox(curr); > flow->computeOverflow(lineTop, lineBottom, textBoxDataMap); > if (!flow->boxModelObject()->hasSelfPaintingLayer()) >Index: Source/WebCore/rendering/InlineIterator.h >=================================================================== >--- Source/WebCore/rendering/InlineIterator.h (revision 155948) >+++ Source/WebCore/rendering/InlineIterator.h (working copy) >@@ -166,7 +166,7 @@ static inline void notifyObserverWillExi > static inline bool isIteratorTarget(RenderObject* object) > { > ASSERT(object); // The iterator will of course return 0, but its not an expected argument to this function. >- return object->isText() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced(); >+ return object->isText() || object->isBR() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced(); > } > > // This enum is only used for bidiNextShared() >Index: Source/WebCore/rendering/InlineTextBox.cpp >=================================================================== >--- Source/WebCore/rendering/InlineTextBox.cpp (revision 155948) >+++ Source/WebCore/rendering/InlineTextBox.cpp (working copy) >@@ -109,8 +109,6 @@ LayoutUnit InlineTextBox::lineHeight() c > { > if (!isText() || !renderer().parent()) > return 0; >- if (renderer().isBR()) >- return toRenderBR(renderer()).lineHeight(isFirstLineStyle()); > if (&parent()->renderer() == renderer().parent()) > return parent()->lineHeight(); > return toRenderBoxModelObject(renderer().parent())->lineHeight(isFirstLineStyle(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); >@@ -367,7 +365,7 @@ void updateGraphicsContext(GraphicsConte > > bool InlineTextBox::isLineBreak() const > { >- return renderer().isBR() || (renderer().style()->preserveNewline() && len() == 1 && (*textRenderer().text())[start()] == '\n'); >+ return renderer().style()->preserveNewline() && len() == 1 && (*textRenderer().text())[start()] == '\n'; > } > > bool InlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) >Index: Source/WebCore/rendering/RenderBR.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBR.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderBR.cpp (working copy) >@@ -1,6 +1,6 @@ > /** > * Copyright (C) 2000 Lars Knoll (knoll@kde.org) >- * Copyright (C) 2006 Apple Computer, Inc. >+ * Copyright (C) 2006, 2013 Apple Computer, Inc. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -23,60 +23,173 @@ > #include "RenderBR.h" > > #include "Document.h" >-#include "InlineTextBox.h" >+#include "RenderBlock.h" >+#include "RootInlineBox.h" > #include "VisiblePosition.h" > > namespace WebCore { > >-static PassRefPtr<StringImpl> newlineString() >+static const int invalidLineHeight = -1; >+ >+RenderBR::RenderBR(Element* element) >+ : RenderBoxModelObject(element) >+ , m_inlineBoxWrapper(nullptr) >+ , m_cachedLineHeight(invalidLineHeight) > { >- DEFINE_STATIC_LOCAL(const String, string, (ASCIILiteral("\n"))); >- return string.impl(); > } > >-RenderBR::RenderBR(Node* node) >- : RenderText(node, newlineString()) >- , m_lineHeight(-1) >+RenderBR::~RenderBR() > { >+ if (m_inlineBoxWrapper) >+ m_inlineBoxWrapper->destroy(renderArena()); > } > >-RenderBR::~RenderBR() >+RenderBR* RenderBR::createAnonymous(Document& document) > { >+ RenderBR* renderer = new (*document.renderArena()) RenderBR(nullptr); >+ renderer->setDocumentForAnonymous(document); >+ return renderer; > } > >-int RenderBR::lineHeight(bool firstLine) const >+LayoutUnit RenderBR::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const > { > if (firstLine && document().styleSheetCollection()->usesFirstLineRules()) { > RenderStyle* s = style(firstLine); > if (s != style()) > return s->computedLineHeight(&view()); > } >+ >+ if (m_cachedLineHeight == invalidLineHeight) >+ m_cachedLineHeight = style()->computedLineHeight(&view()); > >- if (m_lineHeight == -1) >- m_lineHeight = style()->computedLineHeight(&view()); >- >- return m_lineHeight; >+ return m_cachedLineHeight; > } > >-void RenderBR::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) >+int RenderBR::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const > { >- RenderText::styleDidChange(diff, oldStyle); >- m_lineHeight = -1; >+ const FontMetrics& fontMetrics = style(firstLine)->fontMetrics(); >+ return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2; > } > >-int RenderBR::caretMinOffset() const >-{ >+InlineBox* RenderBR::createInlineBox() >+{ >+ return new (renderArena()) InlineBox(*this); >+} >+ >+void RenderBR::setInlineBoxWrapper(InlineBox* inlineBox) >+{ >+ ASSERT(!inlineBox || !m_inlineBoxWrapper); >+ m_inlineBoxWrapper = inlineBox; >+} >+ >+void RenderBR::replaceInlineBoxWrapper(InlineBox* inlineBox) >+{ >+ deleteInlineBoxWrapper(); >+ setInlineBoxWrapper(inlineBox); >+} >+ >+void RenderBR::deleteInlineBoxWrapper() >+{ >+ if (!m_inlineBoxWrapper) >+ return; >+ if (!documentBeingDestroyed()) >+ m_inlineBoxWrapper->remove(); >+ m_inlineBoxWrapper->destroy(renderArena()); >+ m_inlineBoxWrapper = nullptr; >+} >+ >+void RenderBR::dirtyLineBoxes(bool fullLayout) >+{ >+ if (!m_inlineBoxWrapper) >+ return; >+ if (fullLayout) { >+ m_inlineBoxWrapper->destroy(renderArena()); >+ m_inlineBoxWrapper = nullptr; >+ return; >+ } >+ m_inlineBoxWrapper->dirtyLineBoxes(); >+} >+ >+int RenderBR::caretMinOffset() const >+{ > return 0; > } > >-int RenderBR::caretMaxOffset() const >+int RenderBR::caretMaxOffset() const > { > return 1; > } > >+bool RenderBR::canBeSelectionLeaf() const >+{ >+ return true; >+} >+ > VisiblePosition RenderBR::positionForPoint(const LayoutPoint&) > { > return createVisiblePosition(0, DOWNSTREAM); > } > >+void RenderBR::setSelectionState(SelectionState state) >+{ >+ RenderBoxModelObject::setSelectionState(state); >+ if (!m_inlineBoxWrapper) >+ return; >+ m_inlineBoxWrapper->root().setHasSelectedChildren(state != SelectionNone); >+} >+ >+LayoutRect RenderBR::localCaretRect(InlineBox* inlineBox, int caretOffset, LayoutUnit* extraWidthToEndOfLine) >+{ >+ ASSERT_UNUSED(caretOffset, !caretOffset); >+ ASSERT_UNUSED(inlineBox, inlineBox == m_inlineBoxWrapper); >+ if (!inlineBox) >+ return LayoutRect(); >+ >+ static const unsigned caretWidth = 1; >+ const RootInlineBox& rootBox = inlineBox->root(); >+ return rootBox.computeCaretRect(inlineBox->logicalLeft(), caretWidth, extraWidthToEndOfLine); >+} >+ >+IntRect RenderBR::linesBoundingBox() const >+{ >+ if (!m_inlineBoxWrapper) >+ return IntRect(); >+ >+ float logicalLeftSide = m_inlineBoxWrapper->logicalLeft(); >+ float logicalRightSide = m_inlineBoxWrapper->logicalRight(); >+ >+ bool isHorizontal = style()->isHorizontalWritingMode(); >+ >+ float x = isHorizontal ? logicalLeftSide : m_inlineBoxWrapper->x(); >+ float y = isHorizontal ? m_inlineBoxWrapper->y() : logicalLeftSide; >+ float width = isHorizontal ? logicalRightSide - logicalLeftSide : m_inlineBoxWrapper->logicalBottom() - x; >+ float height = isHorizontal ? m_inlineBoxWrapper->logicalBottom() - y : logicalRightSide - logicalLeftSide; >+ return enclosingIntRect(FloatRect(x, y, width, height)); >+} >+ >+void RenderBR::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const >+{ >+ if (!m_inlineBoxWrapper) >+ return; >+ rects.append(enclosingIntRect(FloatRect(accumulatedOffset + m_inlineBoxWrapper->topLeft(), m_inlineBoxWrapper->size()))); >+} >+ >+void RenderBR::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const >+{ >+ if (!m_inlineBoxWrapper) >+ return; >+ quads.append(localToAbsoluteQuad(FloatRect(m_inlineBoxWrapper->topLeft(), m_inlineBoxWrapper->size()), 0 /* mode */, wasFixed)); >+} >+ >+void RenderBR::updateFromStyle() >+{ >+ m_cachedLineHeight = invalidLineHeight; >+} >+ >+IntRect RenderBR::borderBoundingBox() const >+{ >+ IntRect boundingBox = linesBoundingBox(); >+ return IntRect(0, 0, boundingBox.width(), boundingBox.height()); >+} >+ > } // namespace WebCore >Index: Source/WebCore/rendering/RenderBR.h >=================================================================== >--- Source/WebCore/rendering/RenderBR.h (revision 155948) >+++ Source/WebCore/rendering/RenderBR.h (working copy) >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2000 Lars Knoll (knoll@kde.org) >+ * Copyright (C) 2013 Apple Computer, Inc. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -21,43 +22,65 @@ > #ifndef RenderBR_h > #define RenderBR_h > >-#include "RenderText.h" >+#include "RenderBoxModelObject.h" > >-/* >- * The whole class here is a hack to get <br> working, as long as we don't have support for >- * CSS2 :before and :after pseudo elements >- */ > namespace WebCore { > > class Position; > >-class RenderBR FINAL : public RenderText { >+class RenderBR FINAL : public RenderBoxModelObject { > public: >- explicit RenderBR(Node*); >+ explicit RenderBR(Element*); > virtual ~RenderBR(); > >+ static RenderBR* createAnonymous(Document&); >+ > virtual const char* renderName() const { return "RenderBR"; } >- >- virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* /*repaintContainer*/, bool /*clipToVisibleContent*/) OVERRIDE { return LayoutRect(); } > >- virtual float width(unsigned /*from*/, unsigned /*len*/, const Font&, float /*xPos*/, HashSet<const SimpleFontData*>* = 0 /*fallbackFonts*/ , GlyphOverflow* = 0) const { return 0; } >- virtual float width(unsigned /*from*/, unsigned /*len*/, float /*xpos*/, bool = false /*firstLine*/, HashSet<const SimpleFontData*>* = 0 /*fallbackFonts*/, GlyphOverflow* = 0) const { return 0; } >+ InlineBox* createInlineBox(); >+ InlineBox* inlineBoxWrapper() const { return m_inlineBoxWrapper; } >+ void setInlineBoxWrapper(InlineBox*); >+ void deleteInlineBoxWrapper(); >+ void replaceInlineBoxWrapper(InlineBox*); >+ void dirtyLineBoxes(bool fullLayout); > >- int lineHeight(bool firstLine) const; >+ IntRect linesBoundingBox() const; > >- // overrides >- virtual bool isBR() const { return true; } >+ virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const OVERRIDE; >+ virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRIDE; > >- virtual int caretMinOffset() const; >- virtual int caretMaxOffset() const; >+private: >+ virtual bool isBR() const OVERRIDE { return true; } > >- virtual VisiblePosition positionForPoint(const LayoutPoint&); >+ virtual VisiblePosition positionForPoint(const LayoutPoint&) OVERRIDE; >+ virtual int caretMinOffset() const OVERRIDE; >+ virtual int caretMaxOffset() const OVERRIDE; >+ virtual bool canBeSelectionLeaf() const OVERRIDE; >+ virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine) OVERRIDE; >+ virtual void setSelectionState(SelectionState) OVERRIDE; >+ >+ virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode) const OVERRIDE; >+ virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode) const OVERRIDE; >+ >+ virtual LayoutUnit marginTop() const OVERRIDE { return 0; } >+ virtual LayoutUnit marginBottom() const OVERRIDE { return 0; } >+ virtual LayoutUnit marginLeft() const OVERRIDE { return 0; } >+ virtual LayoutUnit marginRight() const OVERRIDE { return 0; } >+ virtual LayoutUnit marginBefore(const RenderStyle*) const OVERRIDE { return 0; } >+ virtual LayoutUnit marginAfter(const RenderStyle*) const OVERRIDE { return 0; } >+ virtual LayoutUnit marginStart(const RenderStyle*) const OVERRIDE { return 0; } >+ virtual LayoutUnit marginEnd(const RenderStyle*) const OVERRIDE { return 0; } >+ virtual LayoutUnit offsetWidth() const OVERRIDE { return linesBoundingBox().width(); } >+ virtual LayoutUnit offsetHeight() const OVERRIDE { return linesBoundingBox().height(); } >+ virtual IntRect borderBoundingBox() const OVERRIDE; >+ virtual LayoutRect frameRectForStickyPositioning() const OVERRIDE { ASSERT_NOT_REACHED(); return LayoutRect(); } >+ virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const OVERRIDE { return LayoutRect(); } > >-protected: >- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); >+ virtual void updateFromStyle() OVERRIDE; >+ virtual bool requiresLayer() const OVERRIDE { return false; } > >-private: >- mutable int m_lineHeight; >+ InlineBox* m_inlineBoxWrapper; >+ mutable int m_cachedLineHeight; > }; > > inline RenderBR& toRenderBR(RenderObject& object) >@@ -72,6 +95,18 @@ inline const RenderBR& toRenderBR(const > return static_cast<const RenderBR&>(object); > } > >+inline RenderBR* toRenderBR(RenderObject* object) >+{ >+ ASSERT_WITH_SECURITY_IMPLICATION(object->isBR()); >+ return static_cast<RenderBR*>(object); >+} >+ >+inline const RenderBR* toRenderBR(const RenderObject* object) >+{ >+ ASSERT_WITH_SECURITY_IMPLICATION(object->isBR()); >+ return static_cast<const RenderBR*>(object); >+} >+ > // This will catch anyone doing an unnecessary cast. > void toRenderBR(const RenderBR&); > >Index: Source/WebCore/rendering/RenderBlock.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlock.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) >@@ -5111,7 +5111,7 @@ RenderObject* InlineMinMaxIterator::next > if (!result) > break; > >- if (!result->isOutOfFlowPositioned() && (result->isText() || result->isFloating() || result->isReplaced() || result->isRenderInline())) >+ if (!result->isOutOfFlowPositioned() && (result->isText() || result->isBR() || result->isFloating() || result->isReplaced() || result->isRenderInline())) > break; > > current = result; >@@ -5967,7 +5967,7 @@ void RenderBlock::updateFirstLetter() > return; > } > >- if (!currChild->isText() || currChild->isBR()) >+ if (!currChild->isText()) > return; > > // Our layout state is not valid for the repaints we are going to trigger by >Index: Source/WebCore/rendering/RenderBlockLineLayout.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlockLineLayout.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderBlockLineLayout.cpp (working copy) >@@ -32,6 +32,7 @@ > #include "LineLayoutState.h" > #include "Logging.h" > #include "RenderArena.h" >+#include "RenderBR.h" > #include "RenderCombineText.h" > #include "RenderCounter.h" > #include "RenderFlowThread.h" >@@ -263,18 +264,20 @@ static inline InlineBox* createInlineBox > if (isRootLineBox) > return toRenderBlock(obj)->createAndAppendRootInlineBox(); > >- if (obj->isText()) { >- InlineTextBox* textBox = toRenderText(obj)->createInlineTextBox(); >- // We only treat a box as text for a <br> if we are on a line by ourself or in strict mode >- // (Note the use of strict mode. In "almost strict" mode, we don't treat the box for <br> as text.) >- if (obj->isBR()) >- textBox->setIsText(isOnlyRun || obj->document().inNoQuirksMode()); >- return textBox; >- } >+ if (obj->isText()) >+ return toRenderText(obj)->createInlineTextBox(); > > if (obj->isBox()) > return toRenderBox(obj)->createInlineBox(); > >+ if (obj->isBR()) { >+ InlineBox* inlineBox = toRenderBR(obj)->createInlineBox(); >+ // We only treat a box as text for a <br> if we are on a line by ourself or in strict mode >+ // (Note the use of strict mode. In "almost strict" mode, we don't treat the box for <br> as text.) >+ inlineBox->setIsText(isOnlyRun || obj->document().inNoQuirksMode()); >+ return inlineBox; >+ } >+ > return toRenderInline(obj)->createAndAppendInlineFlowBox(); > } > >@@ -293,7 +296,9 @@ static inline void dirtyLineBoxesForRend > RenderText* renderText = toRenderText(o); > updateCounterIfNeeded(renderText); > renderText->dirtyLineBoxes(fullLayout); >- } else >+ } else if (o->isBR()) >+ toRenderBR(o)->dirtyLineBoxes(fullLayout); >+ else > toRenderInline(o)->dirtyLineBoxes(fullLayout); > } > >@@ -388,7 +393,7 @@ static bool reachedEndOfTextRenderer(con > return true; > unsigned pos = run->stop(); > RenderObject* r = run->m_object; >- if (!r->isText() || r->isBR()) >+ if (!r->isText()) > return false; > RenderText* renderText = toRenderText(r); > unsigned length = renderText->textLength(); >@@ -923,6 +928,8 @@ void RenderBlock::computeBlockDirectionP > toRenderText(r->m_object)->positionLineBox(r->m_box); > else if (r->m_object->isBox()) > toRenderBox(r->m_object)->positionLineBox(r->m_box); >+ else if (r->m_object->isBR()) >+ toRenderBR(r->m_object)->replaceInlineBoxWrapper(r->m_box); > } > // Positioned objects and zero-length text nodes destroy their boxes in > // position(), which unnecessarily dirties the line. >@@ -1833,8 +1840,8 @@ void RenderBlockFlow::layoutInlineChildr > else > o->layoutIfNeeded(); > } >- } else if (o->isText() || (o->isRenderInline() && !walker.atEndOfInline())) { >- if (!o->isText()) >+ } else if (o->isText() || o->isBR() || (o->isRenderInline() && !walker.atEndOfInline())) { >+ if (o->isRenderInline()) > toRenderInline(o)->updateAlwaysCreateLineBoxes(layoutState.isFullLayout()); > if (layoutState.isFullLayout() || o->selfNeedsLayout()) > dirtyLineBoxesForRenderer(o, layoutState.isFullLayout()); >@@ -2199,10 +2206,13 @@ static bool requiresLineBox(const Inline > if (it.m_obj->isFloatingOrOutOfFlowPositioned()) > return false; > >+ if (it.m_obj->isBR()) >+ return true; >+ > if (it.m_obj->isRenderInline() && !alwaysRequiresLineBox(it.m_obj) && !requiresLineBoxForContent(toRenderInline(it.m_obj), lineInfo)) > return false; > >- if (!shouldCollapseWhiteSpace(it.m_obj->style(), lineInfo, whitespacePosition) || it.m_obj->isBR()) >+ if (!shouldCollapseWhiteSpace(it.m_obj->style(), lineInfo, whitespacePosition)) > return true; > > UChar current = it.current(); >@@ -2277,7 +2287,7 @@ static bool shouldSkipWhitespaceAfterSta > while (next && next->isFloatingOrOutOfFlowPositioned()) > next = bidiNextSkippingEmptyInlines(block, next); > >- if (next && !next->isBR() && next->isText() && toRenderText(next)->textLength() > 0) { >+ if (next && next->isText() && toRenderText(next)->textLength() > 0) { > RenderText* nextText = toRenderText(next); > UChar nextChar = nextText->characterAt(0); > if (nextText->style()->isCollapsibleWhiteSpace(nextChar)) { >@@ -2554,7 +2564,7 @@ static bool canBreakAtThisPosition(bool > if (autoWrap && currentCharacterIsSpace) > return true; > >- bool nextIsText = (next && (current.m_obj->isText() || isEmptyInline(current.m_obj)) && next->isText() && !next->isBR() && (autoWrap || next->style()->autoWrap())); >+ bool nextIsText = (next && (current.m_obj->isText() || isEmptyInline(current.m_obj)) && next->isText() && (autoWrap || next->style()->autoWrap())); > if (!nextIsText) > return autoWrap; > >Index: Source/WebCore/rendering/RenderInline.cpp >=================================================================== >--- Source/WebCore/rendering/RenderInline.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderInline.cpp (working copy) >@@ -30,6 +30,7 @@ > #include "InlineTextBox.h" > #include "Page.h" > #include "RenderArena.h" >+#include "RenderBR.h" > #include "RenderBlock.h" > #include "RenderFlowThread.h" > #include "RenderFullScreen.h" >@@ -605,6 +606,17 @@ void RenderInline::generateCulledLineBox > else > yield(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth())); > } >+ } else if (curr->isBR()) { >+ if (InlineBox* inlineBox = toRenderBR(curr)->inlineBoxWrapper()) { >+ // FIXME: This could use a helper to share these with text path. >+ const RootInlineBox& rootBox = inlineBox->root(); >+ int logicalTop = rootBox.logicalTop() + (rootBox.renderer().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); >+ int logicalHeight = container->style(rootBox.isFirstLineStyle())->font().fontMetrics().height(); >+ if (isHorizontal) >+ yield(FloatRect(inlineBox->x(), logicalTop, inlineBox->logicalWidth(), logicalHeight)); >+ else >+ yield(FloatRect(logicalTop, inlineBox->y(), logicalHeight, inlineBox->logicalWidth())); >+ } > } > } > } >@@ -895,7 +907,11 @@ InlineBox* RenderInline::culledInlineFir > // direction (aligned to the root box's baseline). > if (curr->isBox()) > return toRenderBox(curr)->inlineBoxWrapper(); >- if (curr->isRenderInline()) { >+ if (curr->isBR()) { >+ RenderBR* renderBR = toRenderBR(curr); >+ if (renderBR->inlineBoxWrapper()) >+ return renderBR->inlineBoxWrapper(); >+ } else if (curr->isRenderInline()) { > RenderInline* currInline = toRenderInline(curr); > InlineBox* result = currInline->firstLineBoxIncludingCulling(); > if (result) >@@ -919,7 +935,11 @@ InlineBox* RenderInline::culledInlineLas > // direction (aligned to the root box's baseline). > if (curr->isBox()) > return toRenderBox(curr)->inlineBoxWrapper(); >- if (curr->isRenderInline()) { >+ if (curr->isBR()) { >+ RenderBR* renderBR = toRenderBR(curr); >+ if (renderBR->inlineBoxWrapper()) >+ return renderBR->inlineBoxWrapper(); >+ } else if (curr->isRenderInline()) { > RenderInline* currInline = toRenderInline(curr); > InlineBox* result = currInline->lastLineBoxIncludingCulling(); > if (result) >@@ -1294,6 +1314,10 @@ void RenderInline::dirtyLineBoxes(bool f > RenderText* currText = toRenderText(curr); > for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) > childText->root().markDirty(); >+ } else if (curr->isBR()) { >+ RenderBR* currBR = toRenderBR(curr); >+ if (currBR->inlineBoxWrapper()) >+ currBR->inlineBoxWrapper()->root().markDirty(); > } > } > } >Index: Source/WebCore/rendering/RenderLineBoxList.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLineBoxList.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderLineBoxList.cpp (working copy) >@@ -33,6 +33,7 @@ > #include "InlineTextBox.h" > #include "PaintInfo.h" > #include "RenderArena.h" >+#include "RenderBR.h" > #include "RenderInline.h" > #include "RenderView.h" > #include "RootInlineBox.h" >@@ -341,6 +342,10 @@ void RenderLineBoxList::dirtyLinesFromCh > InlineBox* wrapper = toRenderBox(curr)->inlineBoxWrapper(); > if (wrapper) > box = &wrapper->root(); >+ } if (curr->isBR()) { >+ InlineBox* wrapper = toRenderBR(curr)->inlineBoxWrapper(); >+ if (wrapper) >+ box = &wrapper->root(); > } else if (curr->isText()) { > InlineTextBox* textBox = toRenderText(curr)->lastTextBox(); > if (textBox) >Index: Source/WebCore/rendering/RenderMenuList.cpp >=================================================================== >--- Source/WebCore/rendering/RenderMenuList.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderMenuList.cpp (working copy) >@@ -41,6 +41,7 @@ > #include "PopupMenu.h" > #include "RenderBR.h" > #include "RenderScrollbar.h" >+#include "RenderText.h" > #include "RenderTheme.h" > #include "RenderView.h" > #include "Settings.h" >@@ -56,8 +57,9 @@ using namespace HTMLNames; > > RenderMenuList::RenderMenuList(HTMLSelectElement& element) > : RenderFlexibleBox(&element) >- , m_buttonText(0) >- , m_innerBlock(0) >+ , m_buttonText(nullptr) >+ , m_buttonBR(nullptr) >+ , m_innerBlock(nullptr) > , m_needsOptionsWidthUpdate(true) > , m_optionsWidth(0) > , m_lastActiveIndex(-1) >@@ -160,6 +162,8 @@ void RenderMenuList::styleDidChange(Styl > > if (m_buttonText) > m_buttonText->setStyle(style()); >+ if (m_buttonBR) >+ m_buttonBR->setStyle(style()); > if (m_innerBlock) // RenderBlock handled updating the anonymous block's style. > adjustInnerStyle(); > >@@ -240,19 +244,24 @@ void RenderMenuList::setTextFromOption(i > void RenderMenuList::setText(const String& s) > { > if (s.isEmpty()) { >- if (!m_buttonText || !m_buttonText->isBR()) { >- if (m_buttonText) >+ if (!m_buttonBR) { >+ if (m_buttonText) { > m_buttonText->destroy(); >- m_buttonText = new (renderArena()) RenderBR(&document()); >- m_buttonText->setStyle(style()); >- addChild(m_buttonText); >+ m_buttonText = nullptr; >+ } >+ // FIXME: This could probably just be a text node. >+ m_buttonBR = RenderBR::createAnonymous(document()); >+ m_buttonBR->setStyle(style()); >+ addChild(m_buttonBR); > } > } else { >- if (m_buttonText && !m_buttonText->isBR()) >+ if (m_buttonText) > m_buttonText->setText(s.impl(), true); > else { >- if (m_buttonText) >- m_buttonText->destroy(); >+ if (m_buttonBR) { >+ m_buttonBR->destroy(); >+ m_buttonBR = nullptr; >+ } > m_buttonText = new (renderArena()) RenderText(&document(), s.impl()); > m_buttonText->setStyle(style()); > addChild(m_buttonText); >@@ -263,7 +272,7 @@ void RenderMenuList::setText(const Strin > > String RenderMenuList::text() const > { >- return m_buttonText ? m_buttonText->text() : 0; >+ return m_buttonText ? m_buttonText->text() : m_buttonBR ? String(ASCIILiteral("\n")) : String(); > } > > LayoutRect RenderMenuList::controlClipRect(const LayoutPoint& additionalOffset) const >Index: Source/WebCore/rendering/RenderMenuList.h >=================================================================== >--- Source/WebCore/rendering/RenderMenuList.h (revision 155948) >+++ Source/WebCore/rendering/RenderMenuList.h (working copy) >@@ -38,6 +38,7 @@ > namespace WebCore { > > class HTMLSelectElement; >+class RenderBR; > class RenderText; > > class RenderMenuList FINAL : public RenderFlexibleBox, private PopupMenuClient { >@@ -136,6 +137,7 @@ private: > void didUpdateActiveOption(int optionIndex); > > RenderText* m_buttonText; >+ RenderBR* m_buttonBR; > RenderBlock* m_innerBlock; > > bool m_needsOptionsWidthUpdate; >Index: Source/WebCore/rendering/RenderObject.h >=================================================================== >--- Source/WebCore/rendering/RenderObject.h (revision 155948) >+++ Source/WebCore/rendering/RenderObject.h (working copy) >@@ -1201,7 +1201,7 @@ inline bool RenderObject::isBeforeConten > if (style()->styleType() != BEFORE) > return false; > // Text nodes don't have their own styles, so ignore the style on a text node. >- if (isText() && !isBR()) >+ if (isText()) > return false; > return true; > } >@@ -1211,7 +1211,7 @@ inline bool RenderObject::isAfterContent > if (style()->styleType() != AFTER) > return false; > // Text nodes don't have their own styles, so ignore the style on a text node. >- if (isText() && !isBR()) >+ if (isText()) > return false; > return true; > } >Index: Source/WebCore/rendering/RenderObjectChildList.cpp >=================================================================== >--- Source/WebCore/rendering/RenderObjectChildList.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderObjectChildList.cpp (working copy) >@@ -28,6 +28,7 @@ > #include "RenderObjectChildList.h" > > #include "AXObjectCache.h" >+#include "RenderBR.h" > #include "RenderCounter.h" > #include "RenderObject.h" > #include "RenderStyle.h" >@@ -75,6 +76,8 @@ RenderObject* RenderObjectChildList::rem > // If we have a line box wrapper, delete it. > if (oldChild->isBox()) > toRenderBox(oldChild)->deleteLineBoxWrapper(); >+ else if (oldChild->isBR()) >+ toRenderBR(oldChild)->deleteInlineBoxWrapper(); > > // If oldChild is the start or end of the selection, then clear the selection to > // avoid problems of invalid pointers. >Index: Source/WebCore/rendering/RenderText.cpp >=================================================================== >--- Source/WebCore/rendering/RenderText.cpp (revision 155949) >+++ Source/WebCore/rendering/RenderText.cpp (working copy) >@@ -231,11 +231,6 @@ void RenderText::removeAndDestroyTextBox > { > if (!documentBeingDestroyed()) { > if (firstTextBox()) { >- if (isBR()) { >- RootInlineBox* next = firstTextBox()->root().nextRootBox(); >- if (next) >- next->markDirty(); >- } > for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) > box->remove(); > } else if (parent()) >@@ -888,9 +883,6 @@ void RenderText::computePreferredLogical > m_endMinWidth = 0; > m_maxWidth = 0; > >- if (isBR()) >- return; >- > float currMinWidth = 0; > float currMaxWidth = 0; > m_hasBreakableChar = false; >@@ -1365,7 +1357,6 @@ void RenderText::setTextInternal(PassRef > } > > ASSERT(m_text); >- ASSERT(!isBR() || (textLength() == 1 && m_text[0] == '\n')); > > m_isAllASCII = m_text.containsOnlyASCII(); > m_canUseSimpleFontCodePath = computeCanUseSimpleFontCodePath(); >Index: Source/WebCore/rendering/RenderTreeAsText.cpp >=================================================================== >--- Source/WebCore/rendering/RenderTreeAsText.cpp (revision 155948) >+++ Source/WebCore/rendering/RenderTreeAsText.cpp (working copy) >@@ -251,9 +251,15 @@ void RenderTreeAsText::writeRenderObject > r = IntRect(text.firstRunX(), text.firstRunY(), linesBox.width(), linesBox.height()); > if (adjustForTableCells && !text.firstTextBox()) > adjustForTableCells = false; >+ } else if (o.isBR()) { >+ const RenderBR& br = toRenderBR(o); >+ IntRect linesBox = br.linesBoundingBox(); >+ r = IntRect(linesBox.x(), linesBox.y(), linesBox.width(), linesBox.height()); >+ if (!br.inlineBoxWrapper()) >+ adjustForTableCells = false; > } else if (o.isRenderInline()) { >- // FIXME: Would be better not to just dump 0, 0 as the x and y here. > const RenderInline& inlineFlow = toRenderInline(o); >+ // FIXME: Would be better not to just dump 0, 0 as the x and y here. > r = IntRect(0, 0, inlineFlow.linesBoundingBox().width(), inlineFlow.linesBoundingBox().height()); > adjustForTableCells = false; > } else if (o.isTableCell()) { >@@ -273,7 +279,7 @@ void RenderTreeAsText::writeRenderObject > // for consistency with old results. > ts << " " << enclosingIntRect(r); > >- if (!(o.isText() && !o.isBR())) { >+ if (!o.isText()) { > if (o.isFileUploadControl()) > ts << " " << quoteAndEscapeNonPrintables(toRenderFileUploadControl(&o)->fileTextValue()); > >@@ -302,7 +308,7 @@ void RenderTreeAsText::writeRenderObject > ts << " [textStrokeWidth=" << o.style()->textStrokeWidth() << "]"; > } > >- if (!o.isBoxModelObject()) >+ if (!o.isBoxModelObject() || o.isBR()) > return; > > const RenderBoxModelObject& box = toRenderBoxModelObject(o); >Index: Source/WebCore/rendering/RootInlineBox.cpp >=================================================================== >--- Source/WebCore/rendering/RootInlineBox.cpp (revision 155949) >+++ Source/WebCore/rendering/RootInlineBox.cpp (working copy) >@@ -846,7 +846,7 @@ void RootInlineBox::ascentAndDescentForB > > Vector<const SimpleFontData*>* usedFonts = 0; > GlyphOverflow* glyphOverflow = 0; >- if (box->isText()) { >+ if (box->isInlineTextBox()) { > GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(toInlineTextBox(box)); > usedFonts = it == textBoxDataMap.end() ? 0 : &it->value.first; > glyphOverflow = it == textBoxDataMap.end() ? 0 : &it->value.second; >@@ -915,7 +915,7 @@ void RootInlineBox::ascentAndDescentForB > if (includeMarginForBox(box)) { > LayoutUnit ascentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType()); > LayoutUnit descentWithMargin = box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType()); >- if (box->parent() && !box->renderer().isText()) { >+ if (box->parent() && !box->renderer().isText() && !box->renderer().isBR()) { > ascentWithMargin += box->boxModelObject()->borderAndPaddingBefore() + box->boxModelObject()->marginBefore(); > descentWithMargin += box->boxModelObject()->borderAndPaddingAfter() + box->boxModelObject()->marginAfter(); > } >@@ -929,7 +929,7 @@ void RootInlineBox::ascentAndDescentForB > > LayoutUnit RootInlineBox::verticalPositionForBox(InlineBox* box, VerticalPositionCache& verticalPositionCache) > { >- if (box->renderer().isText()) >+ if (box->renderer().isText() || box->renderer().isBR()) > return box->parent()->logicalTop(); > > RenderBoxModelObject* renderer = box->boxModelObject(); >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 155950) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2013-09-17 Antti Koivisto <antti@apple.com> >+ >+ RenderBR should not be RenderText >+ https://bugs.webkit.org/show_bug.cgi?id=121221 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * editing/selection/move-by-word-visually-mac-expected.txt: >+ >+ This is a progression. A previously failing subtest passes. >+ >+ * platform/mac/css3/selectors3/html/css3-modsel-179a-expected.txt: >+ * platform/mac/css3/selectors3/xhtml/css3-modsel-179a-expected.txt: >+ * platform/mac/css3/selectors3/xml/css3-modsel-179a-expected.txt: >+ >+ Changes in render tree dumb that don't affect rendering. >+ >+ * platform/mac/fast/css/pseudo-first-line-border-width-expected.txt: >+ >+ This is a progression. The new rendering matches Firefox. >+ >+ * platform/mac/fast/css/word-space-extra-expected.txt: >+ * platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt: >+ >+ Changes in render tree dumb that don't affect rendering. >+ > 2013-09-17 Mihnea Ovidenie <mihnea@adobe.com> > > [CSSRegions] Flowed fixed element without its transformed parent positioned relative to viewport >Index: LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt >=================================================================== >--- LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt (revision 155948) >+++ LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt (working copy) >@@ -87,9 +87,7 @@ Move left by one word > "opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0] > Test 18, RTL: > Move left by one word >-" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 8, 12, 16, 20, 24, 28, 32, 36], <DIV>[0], <DIV>[0], "AAA kj AAA mn opq AAA AAA"[3, 6, 10, 13, 17, 21, 25] FAIL expected: [" abc def AAA AAA hij AAA AAA uvw xyz "[ 1, 5, 8, 12, 16, 20, 24, 28, 32, 36, ]"AAA kj AAA mn opq AAA AAA"[ 3, 6, 10, 13, 17, 21, 25] >-" abc def AAA AAA hij AAA AAA uvw xyz "[36], <DIV>[0] FAIL expected "AAA kj AAA mn opq AAA AAA"[ 3] >-<DIV>[0], <DIV>[0] FAIL expected "AAA kj AAA mn opq AAA AAA"[ 3] >+" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 8, 12, 16, 20, 24, 28, 32, 36], "AAA kj AAA mn opq AAA AAA"[3, 6, 10, 13, 17, 21, 25] > Move right by one word > "AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 13, 9, 4, 1] > Test 19, LTR: >Index: LayoutTests/platform/mac/css3/selectors3/html/css3-modsel-179a-expected.txt >=================================================================== >--- LayoutTests/platform/mac/css3/selectors3/html/css3-modsel-179a-expected.txt (revision 155948) >+++ LayoutTests/platform/mac/css3/selectors3/html/css3-modsel-179a-expected.txt (working copy) >@@ -4,6 +4,6 @@ layer at (0,0) size 800x124 > RenderBlock {HTML} at (0,0) size 800x124 > RenderBody {BODY} at (8,16) size 784x92 > RenderBlock {P} at (0,0) size 784x92 [color=#008000] >- RenderBR {BR} at (0,0) size 0x74 >+ RenderBR {BR} at (0,44) size 0x18 > RenderText {#text} at (0,74) size 163x18 > text run at (0,74) width 163: "This line should be green." >Index: LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-179a-expected.txt >=================================================================== >--- LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-179a-expected.txt (revision 155948) >+++ LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-179a-expected.txt (working copy) >@@ -4,6 +4,6 @@ layer at (0,0) size 800x124 > RenderBlock {html} at (0,0) size 800x124 > RenderBody {body} at (8,16) size 784x92 > RenderBlock {p} at (0,0) size 784x92 [color=#008000] >- RenderBR {br} at (0,0) size 0x74 >+ RenderBR {br} at (0,44) size 0x18 > RenderText {#text} at (0,74) size 163x18 > text run at (0,74) width 163: "This line should be green." >Index: LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-179a-expected.txt >=================================================================== >--- LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-179a-expected.txt (revision 155948) >+++ LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-179a-expected.txt (working copy) >@@ -3,6 +3,6 @@ layer at (0,0) size 800x600 > layer at (0,0) size 800x124 > RenderBlock {test} at (0,0) size 800x124 > RenderBlock {p} at (0,16) size 800x92 [color=#008000] >- RenderBR {br} at (0,0) size 0x74 >+ RenderBR {br} at (0,44) size 0x18 > RenderText {#text} at (0,74) size 163x18 > text run at (0,74) width 163: "This line should be green." >Index: LayoutTests/platform/mac/fast/css/pseudo-first-line-border-width-expected.txt >=================================================================== >--- LayoutTests/platform/mac/fast/css/pseudo-first-line-border-width-expected.txt (revision 155948) >+++ LayoutTests/platform/mac/fast/css/pseudo-first-line-border-width-expected.txt (working copy) >@@ -1,8 +1,8 @@ > layer at (0,0) size 800x600 > RenderView at (0,0) size 800x600 >-layer at (0,0) size 800x450 >- RenderBlock {HTML} at (0,0) size 800x450 >- RenderBody {BODY} at (8,8) size 784x342 >+layer at (0,0) size 800x540 >+ RenderBlock {HTML} at (0,0) size 800x540 >+ RenderBody {BODY} at (8,8) size 784x432 > RenderBlock {DIV} at (0,0) size 784x32 > RenderText {#text} at (0,0) size 144x16 > text run at (0,0) width 144: "Test for " >@@ -10,13 +10,13 @@ layer at (0,0) size 800x450 > RenderText {#text} at (144,0) size 736x32 > text run at (144,0) width 592: "https://bugs.webkit.org/show_bug.cgi?" > text run at (0,16) width 128: "id=79526" >- RenderBlock {P} at (0,132) size 784x210 >- RenderText {#text} at (0,0) size 350x10 >- text run at (0,0) width 350: "A green 10px border on the left of " >- RenderInline {SPAN} at (0,0) size 500x210 [border: none (100px solid #008000)] >- RenderText {#text} at (360,0) size 50x10 >- text run at (360,0) width 50: "this," >- RenderBR {BR} at (410,0) size 0x10 >- RenderText {#text} at (0,10) size 500x200 >- text run at (0,10) width 400: "is a" >- text run at (0,110) width 500: "pass." >+ RenderBlock {P} at (0,132) size 784x300 >+ RenderText {#text} at (0,72) size 350x10 >+ text run at (0,72) width 350: "A green 10px border on the left of " >+ RenderInline {SPAN} at (0,0) size 500x228 [border: none (100px solid #008000)] >+ RenderText {#text} at (360,72) size 50x10 >+ text run at (360,72) width 50: "this," >+ RenderBR {BR} at (410,0) size 0x100 >+ RenderText {#text} at (0,100) size 500x200 >+ text run at (0,100) width 400: "is a" >+ text run at (0,200) width 500: "pass." >Index: LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt >=================================================================== >--- LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt (revision 155948) >+++ LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt (working copy) >@@ -311,7 +311,7 @@ layer at (0,0) size 785x2393 > text run at (301,2) width 48: "within" > RenderText {#text} at (369,0) size 107x18 > text run at (369,0) width 107: " elements too." >- RenderBR {BR} at (496,14) size 0x0 >+ RenderBR {BR} at (476,14) size 0x0 > RenderText {#text} at (0,18) size 177x18 > text run at (0,18) width 60: "Word " > text run at (60,18) width 117: "spacing test " >@@ -333,7 +333,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (452,18) size 692x36 > text run at (452,18) width 240: "too. (with comment between" > text run at (0,36) width 151: "elements and too)" >- RenderBR {BR} at (171,50) size 0x0 >+ RenderBR {BR} at (151,50) size 0x0 > RenderText {#text} at (0,54) size 177x18 > text run at (0,54) width 60: "Word " > text run at (60,54) width 117: "spacing test " >@@ -355,7 +355,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (448,54) size 753x36 > text run at (448,54) width 305: " too. (with comment (no preceeding" > text run at (0,72) width 292: "space) between elements and too)" >- RenderBR {BR} at (312,86) size 0x0 >+ RenderBR {BR} at (292,86) size 0x0 > RenderText {#text} at (0,90) size 177x18 > text run at (0,90) width 60: "Word " > text run at (60,90) width 117: "spacing test " >@@ -377,7 +377,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (452,90) size 728x36 > text run at (452,90) width 276: "too. (with comment (no trailing" > text run at (0,108) width 292: "space) between elements and too)" >- RenderBR {BR} at (312,122) size 0x0 >+ RenderBR {BR} at (292,122) size 0x0 > RenderInline {SPAN} at (0,0) size 320x15 > RenderText {#text} at (0,128) size 204x15 > text run at (0,128) width 60: "Word " >@@ -398,7 +398,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (412,126) size 720x36 > text run at (412,126) width 308: " elements too. (with monospace font" > text run at (0,144) width 210: "from Word to elements)" >- RenderBR {BR} at (230,158) size 0x0 >+ RenderBR {BR} at (210,158) size 0x0 > RenderText {#text} at (0,162) size 177x18 > text run at (0,162) width 60: "Word " > text run at (60,162) width 117: "spacing test " >@@ -419,7 +419,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (389,162) size 751x36 > text run at (389,162) width 362: " elements too. (with monospace font from" > text run at (0,180) width 123: "for to within)" >- RenderBR {BR} at (143,194) size 0x0 >+ RenderBR {BR} at (123,194) size 0x0 > RenderText {#text} at (0,198) size 177x18 > text run at (0,198) width 60: "Word " > text run at (60,198) width 117: "spacing test " >@@ -1180,7 +1180,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (0,0) size 162x22 > text run at (0,0) width 162: "In a span" > RenderBlock (anonymous) at (0,2035) size 769x342 >- RenderInline {SPAN} at (0,0) size 779x342 >+ RenderInline {SPAN} at (0,0) size 760x342 > RenderText {#text} at (0,0) size 424x18 > text run at (0,0) width 242: "Word and letter " > text run at (242,0) width 182: "spacing test " >@@ -1199,7 +1199,7 @@ layer at (0,0) size 785x2393 > text run at (613,2) width 78: "within" > RenderText {#text} at (0,18) size 168x18 > text run at (0,18) width 168: "elements too." >- RenderBR {BR} at (188,32) size 0x0 >+ RenderBR {BR} at (168,32) size 0x0 > RenderText {#text} at (0,36) size 424x18 > text run at (0,36) width 242: "Word and letter " > text run at (242,36) width 182: "spacing test " >@@ -1220,7 +1220,7 @@ layer at (0,0) size 785x2393 > text run at (0,54) width 124: "elements " > RenderText {#text} at (124,54) size 635x18 > text run at (124,54) width 635: "too. (with comment between elements and too)" >- RenderBR {BR} at (779,68) size 0x0 >+ RenderBR {BR} at (759,68) size 0x0 > RenderText {#text} at (0,72) size 424x18 > text run at (0,72) width 242: "Word and letter " > text run at (242,72) width 182: "spacing test " >@@ -1242,7 +1242,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (115,90) size 689x36 > text run at (115,90) width 574: " too. (with comment (no preceeding space)" > text run at (0,108) width 353: "between elements and too)" >- RenderBR {BR} at (373,122) size 0x0 >+ RenderBR {BR} at (353,122) size 0x0 > RenderText {#text} at (0,126) size 424x18 > text run at (0,126) width 242: "Word and letter " > text run at (242,126) width 182: "spacing test " >@@ -1264,7 +1264,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (124,144) size 654x36 > text run at (124,144) width 530: "too. (with comment (no trailing space)" > text run at (0,162) width 353: "between elements and too)" >- RenderBR {BR} at (373,176) size 0x0 >+ RenderBR {BR} at (353,176) size 0x0 > RenderInline {SPAN} at (0,0) size 653x15 > RenderText {#text} at (0,182) size 477x15 > text run at (0,182) width 268: "Word and letter " >@@ -1285,7 +1285,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (0,198) size 689x36 > text run at (0,198) width 689: "elements too. (with monospace font from Word to" > text run at (0,216) width 105: "elements)" >- RenderBR {BR} at (125,230) size 0x0 >+ RenderBR {BR} at (105,230) size 0x0 > RenderText {#text} at (0,234) size 424x18 > text run at (0,234) width 242: "Word and letter " > text run at (242,234) width 182: "spacing test " >@@ -1306,7 +1306,7 @@ layer at (0,0) size 785x2393 > RenderText {#text} at (0,252) size 666x36 > text run at (0,252) width 666: "elements too. (with monospace font from for to" > text run at (0,270) width 80: "within)" >- RenderBR {BR} at (100,284) size 0x0 >+ RenderBR {BR} at (80,284) size 0x0 > RenderText {#text} at (0,288) size 424x18 > text run at (0,288) width 242: "Word and letter " > text run at (242,288) width 182: "spacing test " >Index: LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt >=================================================================== >--- LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt (revision 155948) >+++ LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt (working copy) >@@ -51,10 +51,10 @@ layer at (0,0) size 785x781 > text run at (0,15) width 24: " " > text run at (0,30) width 24: "bar" > RenderBlock {PRE} at (0,242) size 41x45 [bgcolor=#C0C0C0] >- RenderText {#text} at (0,0) size 56x15 >- text run at (0,0) width 40: "foo " >- text run at (40,0) width 16: " " >- RenderBR {BR} at (56,12) size 0x0 >+ RenderText {#text} at (0,0) size 41x15 >+ text run at (0,0) width 24: "foo" >+ text run at (24,0) width 17: " " >+ RenderBR {BR} at (0,0) size 0x0 > RenderText {#text} at (0,15) size 24x30 > text run at (0,15) width 24: " " > text run at (0,30) width 24: "bar"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
darin
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 121221
:
211415
|
211416
|
211431
|
211433
|
211575
|
211585
|
211607
|
211608
|
211817
|
211826
|
211827
|
211881
|
211893
| 211899