Chromium Code Reviews| Index: Source/core/rendering/InlineFlowBox.cpp |
| diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp |
| index 66e89f3b5e07451a201aeafa4dd0e65654b1724f..1ba75e34f70f98164b176bcc32ca8dca3793aeac 100644 |
| --- a/Source/core/rendering/InlineFlowBox.cpp |
| +++ b/Source/core/rendering/InlineFlowBox.cpp |
| @@ -109,7 +109,7 @@ void InlineFlowBox::addToLine(InlineBox* child) |
| child->setFirstLineStyleBit(isFirstLineStyle()); |
| child->setIsHorizontal(isHorizontal()); |
| if (child->isText()) { |
| - if (child->renderer()->parent() == renderer()) |
| + if (child->renderer().parent() == &renderer()) |
| m_hasTextChildren = true; |
| setHasTextDescendantsOnAncestors(this); |
| } else if (child->isInlineFlowBox()) { |
| @@ -117,14 +117,14 @@ void InlineFlowBox::addToLine(InlineBox* child) |
| setHasTextDescendantsOnAncestors(this); |
| } |
| - if (descendantsHaveSameLineHeightAndBaseline() && !child->renderer()->isOutOfFlowPositioned()) { |
| - RenderStyle* parentStyle = renderer()->style(isFirstLineStyle()); |
| - RenderStyle* childStyle = child->renderer()->style(isFirstLineStyle()); |
| + if (descendantsHaveSameLineHeightAndBaseline() && !child->renderer().isOutOfFlowPositioned()) { |
| + RenderStyle* parentStyle = renderer().style(isFirstLineStyle()); |
| + RenderStyle* childStyle = child->renderer().style(isFirstLineStyle()); |
| bool shouldClearDescendantsHaveSameLineHeightAndBaseline = false; |
| - if (child->renderer()->isReplaced()) |
| + if (child->renderer().isReplaced()) |
| shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| else if (child->isText()) { |
| - if (child->renderer()->isBR() || child->renderer()->parent() != renderer()) { |
| + if (child->renderer().isBR() || child->renderer().parent() != &renderer()) { |
| if (!parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle->font().fontMetrics()) |
| || parentStyle->lineHeight() != childStyle->lineHeight() |
| || (parentStyle->verticalAlign() != BASELINE && !isRootInlineBox()) || childStyle->verticalAlign() != BASELINE) |
| @@ -133,7 +133,7 @@ void InlineFlowBox::addToLine(InlineBox* child) |
| if (childStyle->hasTextCombine() || childStyle->textEmphasisMark() != TextEmphasisMarkNone) |
| shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| } else { |
| - if (child->renderer()->isBR()) { |
| + if (child->renderer().isBR()) { |
| // FIXME: This is dumb. We only turn off because current layout test results expect the <br> to be 0-height on the baseline. |
| // Other than making a zillion tests have to regenerate results, there's no reason to ditch the optimization here. |
| shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| @@ -154,19 +154,21 @@ void InlineFlowBox::addToLine(InlineBox* child) |
| clearDescendantsHaveSameLineHeightAndBaseline(); |
| } |
| - if (!child->renderer()->isOutOfFlowPositioned()) { |
| + if (!child->renderer().isOutOfFlowPositioned()) { |
| if (child->isText()) { |
| - RenderStyle* childStyle = child->renderer()->style(isFirstLineStyle()); |
| + RenderStyle* childStyle = child->renderer().style(isFirstLineStyle()); |
| if (childStyle->letterSpacing() < 0 || childStyle->textShadow() || childStyle->textEmphasisMark() != TextEmphasisMarkNone || childStyle->textStrokeWidth()) |
| child->clearKnownToHaveNoOverflow(); |
| - } else if (child->renderer()->isReplaced()) { |
| - RenderBox* box = toRenderBox(child->renderer()); |
| - if (box->hasRenderOverflow() || box->hasSelfPaintingLayer()) |
| + } else if (child->renderer().isReplaced()) { |
| + RenderBox& box = toRenderBox(child->renderer()); |
| + if (box.hasRenderOverflow() || box.hasSelfPaintingLayer()) |
| child->clearKnownToHaveNoOverflow(); |
| - } else if (!child->renderer()->isBR() && (child->renderer()->style(isFirstLineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer() |
| - || (child->renderer()->isListMarker() && !toRenderListMarker(child->renderer())->isInside()) |
| - || child->renderer()->style(isFirstLineStyle())->hasBorderImageOutsets())) |
| + } else if (!child->renderer().isBR() && (child->renderer().style(isFirstLineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer() |
| + || (child->renderer().isListMarker() && !toRenderListMarker(child->renderer()).isInside()) |
| + || child->renderer().style(isFirstLineStyle())->hasBorderImageOutsets())) { |
| + |
| child->clearKnownToHaveNoOverflow(); |
| + } |
| if (knownToHaveNoOverflow() && child->isInlineFlowBox() && !toInlineFlowBox(child)->knownToHaveNoOverflow()) |
| clearKnownToHaveNoOverflow(); |
| @@ -222,7 +224,7 @@ void InlineFlowBox::deleteLine() |
| void InlineFlowBox::removeLineBoxFromRenderObject() |
| { |
| - toRenderInline(renderer())->lineBoxes()->removeLineBox(this); |
| + rendererLineBoxes()->removeLineBox(this); |
| } |
| void InlineFlowBox::extractLine() |
| @@ -235,7 +237,7 @@ void InlineFlowBox::extractLine() |
| void InlineFlowBox::extractLineBoxFromRenderObject() |
| { |
| - toRenderInline(renderer())->lineBoxes()->extractLineBox(this); |
| + rendererLineBoxes()->extractLineBox(this); |
| } |
| void InlineFlowBox::attachLine() |
| @@ -248,7 +250,7 @@ void InlineFlowBox::attachLine() |
| void InlineFlowBox::attachLineBoxToRenderObject() |
| { |
| - toRenderInline(renderer())->lineBoxes()->attachLineBox(this); |
| + toRenderInline(renderer()).lineBoxes()->attachLineBox(this); |
|
Inactive
2014/02/28 02:28:19
rendererLineBoxes()->attachLineBox(this);
ostap
2014/02/28 08:29:14
Done.
|
| } |
| void InlineFlowBox::adjustPosition(float dx, float dy) |
| @@ -262,7 +264,7 @@ void InlineFlowBox::adjustPosition(float dx, float dy) |
| RenderLineBoxList* InlineFlowBox::rendererLineBoxes() const |
| { |
| - return toRenderInline(renderer())->lineBoxes(); |
| + return toRenderInline(renderer()).lineBoxes(); |
| } |
| static inline bool isLastChildForRenderer(RenderObject* ancestor, RenderObject* child) |
| @@ -308,13 +310,13 @@ void InlineFlowBox::determineSpacingForFlowBoxes(bool lastLine, bool isLogically |
| // The root inline box never has borders/margins/padding. |
| if (parent()) { |
| - bool ltr = renderer()->style()->isLeftToRightDirection(); |
| + bool ltr = renderer().style()->isLeftToRightDirection(); |
| // Check to see if all initial lines are unconstructed. If so, then |
| // we know the inline began on this line (unless we are a continuation). |
| RenderLineBoxList* lineBoxList = rendererLineBoxes(); |
| - if (!lineBoxList->firstLineBox()->isConstructed() && !renderer()->isInlineElementContinuation()) { |
| - if (renderer()->style()->boxDecorationBreak() == DCLONE) |
| + if (!lineBoxList->firstLineBox()->isConstructed() && !renderer().isInlineElementContinuation()) { |
| + if (renderer().style()->boxDecorationBreak() == DCLONE) |
| includeLeftEdge = includeRightEdge = true; |
| else if (ltr && lineBoxList->firstLineBox() == this) |
| includeLeftEdge = true; |
| @@ -323,23 +325,23 @@ void InlineFlowBox::determineSpacingForFlowBoxes(bool lastLine, bool isLogically |
| } |
| if (!lineBoxList->lastLineBox()->isConstructed()) { |
| - RenderInline* inlineFlow = toRenderInline(renderer()); |
| - bool isLastObjectOnLine = !isAnsectorAndWithinBlock(renderer(), logicallyLastRunRenderer) || (isLastChildForRenderer(renderer(), logicallyLastRunRenderer) && !isLogicallyLastRunWrapped); |
| + RenderInline& inlineFlow = toRenderInline(renderer()); |
| + bool isLastObjectOnLine = !isAnsectorAndWithinBlock(&renderer(), logicallyLastRunRenderer) || (isLastChildForRenderer(&renderer(), logicallyLastRunRenderer) && !isLogicallyLastRunWrapped); |
| // We include the border under these conditions: |
| // (1) The next line was not created, or it is constructed. We check the previous line for rtl. |
| // (2) The logicallyLastRun is not a descendant of this renderer. |
| // (3) The logicallyLastRun is a descendant of this renderer, but it is the last child of this renderer and it does not wrap to the next line. |
| // (4) The decoration break is set to clone therefore there will be borders on every sides. |
| - if (renderer()->style()->boxDecorationBreak() == DCLONE) |
| + if (renderer().style()->boxDecorationBreak() == DCLONE) |
| includeLeftEdge = includeRightEdge = true; |
| else if (ltr) { |
| if (!nextLineBox() |
| - && ((lastLine || isLastObjectOnLine) && !inlineFlow->continuation())) |
| + && ((lastLine || isLastObjectOnLine) && !inlineFlow.continuation())) |
| includeRightEdge = true; |
| } else { |
| if ((!prevLineBox() || prevLineBox()->isConstructed()) |
| - && ((lastLine || isLastObjectOnLine) && !inlineFlow->continuation())) |
| + && ((lastLine || isLastObjectOnLine) && !inlineFlow.continuation())) |
| includeLeftEdge = true; |
| } |
| } |
| @@ -377,9 +379,9 @@ float InlineFlowBox::placeBoxesInInlineDirection(float logicalLeft, bool& needsW |
| float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastChild, float& logicalLeft, float& minLogicalLeft, float& maxLogicalRight, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap& textBoxDataMap) |
| { |
| for (InlineBox* curr = firstChild; curr && curr != lastChild; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isText()) { |
| + if (curr->renderer().isText()) { |
| InlineTextBox* text = toInlineTextBox(curr); |
| - RenderText* rt = toRenderText(text->renderer()); |
| + RenderText* rt = &toRenderText(text->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderText& rt = toRenderText(text->renderer());
ostap
2014/02/28 08:29:14
Done.
|
| if (rt->textLength()) { |
| if (needsWordSpacing && isSpaceOrNewline(rt->characterAt(text->start()))) |
| logicalLeft += rt->style(isFirstLineStyle())->font().fontDescription().wordSpacing(); |
| @@ -392,17 +394,18 @@ float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, Inlin |
| if (knownToHaveNoOverflow()) |
| maxLogicalRight = max(logicalLeft, maxLogicalRight); |
| } else { |
| - if (curr->renderer()->isOutOfFlowPositioned()) { |
| - if (curr->renderer()->parent()->style()->isLeftToRightDirection()) |
| + if (curr->renderer().isOutOfFlowPositioned()) { |
| + if (curr->renderer().parent()->style()->isLeftToRightDirection()) { |
| curr->setLogicalLeft(logicalLeft); |
| - else |
| + } else { |
| // Our offset that we cache needs to be from the edge of the right border box and |
| // not the left border box. We have to subtract |x| from the width of the block |
| // (which can be obtained from the root line box). |
| - curr->setLogicalLeft(root()->block()->logicalWidth() - logicalLeft); |
| + curr->setLogicalLeft(root()->block().logicalWidth() - logicalLeft); |
| + } |
| continue; // The positioned object has no effect on the width. |
| } |
| - if (curr->renderer()->isRenderInline()) { |
| + if (curr->renderer().isRenderInline()) { |
| InlineFlowBox* flow = toInlineFlowBox(curr); |
| logicalLeft += flow->marginLogicalLeft(); |
| if (knownToHaveNoOverflow()) |
| @@ -411,7 +414,7 @@ float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, Inlin |
| if (knownToHaveNoOverflow()) |
| maxLogicalRight = max(logicalLeft, maxLogicalRight); |
| logicalLeft += flow->marginLogicalRight(); |
| - } else if (!curr->renderer()->isListMarker() || toRenderListMarker(curr->renderer())->isInside()) { |
| + } else if (!curr->renderer().isListMarker() || toRenderListMarker(curr->renderer()).isInside()) { |
| // The box can have a different writing-mode than the overall line, so this is a bit complicated. |
| // Just get all the physical margin and overflow values by hand based off |isVertical|. |
| LayoutUnit logicalLeftMargin = isHorizontal() ? curr->boxModelObject()->marginLeft() : curr->boxModelObject()->marginTop(); |
| @@ -438,19 +441,19 @@ bool InlineFlowBox::requiresIdeographicBaseline(const GlyphOverflowAndFallbackFo |
| if (isHorizontal()) |
| return false; |
| - if (renderer()->style(isFirstLineStyle())->fontDescription().nonCJKGlyphOrientation() == NonCJKGlyphOrientationUpright |
| - || renderer()->style(isFirstLineStyle())->font().primaryFont()->hasVerticalGlyphs()) |
| + if (renderer().style(isFirstLineStyle())->fontDescription().nonCJKGlyphOrientation() == NonCJKGlyphOrientationUpright |
| + || renderer().style(isFirstLineStyle())->font().primaryFont()->hasVerticalGlyphs()) |
| return true; |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| if (curr->isInlineFlowBox()) { |
| if (toInlineFlowBox(curr)->requiresIdeographicBaseline(textBoxDataMap)) |
| return true; |
| } else { |
| - if (curr->renderer()->style(isFirstLineStyle())->font().primaryFont()->hasVerticalGlyphs()) |
| + if (curr->renderer().style(isFirstLineStyle())->font().primaryFont()->hasVerticalGlyphs()) |
| return true; |
| const Vector<const SimpleFontData*>* usedFonts = 0; |
| @@ -476,7 +479,7 @@ void InlineFlowBox::adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent, i |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| // The computed lineheight needs to be extended for the |
| // positioned elements |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| if (curr->verticalAlign() == TOP || curr->verticalAlign() == BOTTOM) { |
| int lineHeight = curr->lineHeight(); |
| @@ -543,7 +546,7 @@ void InlineFlowBox::computeLogicalBoxHeights(RootInlineBox* rootBox, LayoutUnit& |
| return; |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| InlineFlowBox* inlineFlowBox = curr->isInlineFlowBox() ? toInlineFlowBox(curr) : 0; |
| @@ -600,7 +603,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei |
| { |
| bool isRootBox = isRootInlineBox(); |
| if (isRootBox) { |
| - const FontMetrics& fontMetrics = renderer()->style(isFirstLineStyle())->fontMetrics(); |
| + const FontMetrics& fontMetrics = renderer().style(isFirstLineStyle())->fontMetrics(); |
| // RootInlineBoxes are always placed on at pixel boundaries in their logical y direction. Not doing |
| // so results in incorrect rendering of text decorations, most notably underlines. |
| setLogicalTop(roundToInt(top + maxAscent - fontMetrics.ascent(baselineType))); |
| @@ -614,7 +617,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei |
| } |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| if (descendantsHaveSameLineHeightAndBaseline()) { |
| @@ -642,16 +645,16 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei |
| LayoutUnit boxHeightIncludingMargins = boxHeight; |
| if (curr->isText() || curr->isInlineFlowBox()) { |
| - const FontMetrics& fontMetrics = curr->renderer()->style(isFirstLineStyle())->fontMetrics(); |
| + const FontMetrics& fontMetrics = curr->renderer().style(isFirstLineStyle())->fontMetrics(); |
| newLogicalTop += curr->baselinePosition(baselineType) - fontMetrics.ascent(baselineType); |
| if (curr->isInlineFlowBox()) { |
| - RenderBoxModelObject* boxObject = toRenderBoxModelObject(curr->renderer()); |
| + RenderBoxModelObject* boxObject = &toRenderBoxModelObject(curr->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderBoxModelObject& boxObject = toRenderBoxModel
ostap
2014/02/28 08:29:14
Done.
|
| newLogicalTop -= boxObject->style(isFirstLineStyle())->isHorizontalWritingMode() ? boxObject->borderTop() + boxObject->paddingTop() : |
| boxObject->borderRight() + boxObject->paddingRight(); |
| } |
| newLogicalTopIncludingMargins = newLogicalTop; |
| - } else if (!curr->renderer()->isBR()) { |
| - RenderBox* box = toRenderBox(curr->renderer()); |
| + } else if (!curr->renderer().isBR()) { |
| + RenderBox* box = &toRenderBox(curr->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderBox& box = toRenderBox(curr->renderer());
ostap
2014/02/28 08:29:14
Done.
|
| newLogicalTopIncludingMargins = newLogicalTop; |
| LayoutUnit overSideMargin = curr->isHorizontal() ? box->marginTop() : box->marginRight(); |
| LayoutUnit underSideMargin = curr->isHorizontal() ? box->marginBottom() : box->marginLeft(); |
| @@ -662,28 +665,28 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei |
| curr->setLogicalTop(newLogicalTop); |
| if (childAffectsTopBottomPos) { |
| - if (curr->renderer()->isRubyRun()) { |
| + if (curr->renderer().isRubyRun()) { |
| // Treat the leading on the first and last lines of ruby runs as not being part of the overall lineTop/lineBottom. |
| // Really this is a workaround hack for the fact that ruby should have been done as line layout and not done using |
| // inline-block. |
| - if (renderer()->style()->isFlippedLinesWritingMode() == (curr->renderer()->style()->rubyPosition() == RubyPositionAfter)) |
| + if (renderer().style()->isFlippedLinesWritingMode() == (curr->renderer().style()->rubyPosition() == RubyPositionAfter)) |
| hasAnnotationsBefore = true; |
| else |
| hasAnnotationsAfter = true; |
| - RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer()); |
| + RenderRubyRun* rubyRun = &toRenderRubyRun(curr->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderRubyRun& rubyRun = toRenderRubyRun(curr->ren
ostap
2014/02/28 08:29:14
Done.
|
| if (RenderRubyBase* rubyBase = rubyRun->rubyBase()) { |
| LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : LayoutUnit()); |
| LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : LayoutUnit()); |
| - newLogicalTop += !renderer()->style()->isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading; |
| + newLogicalTop += !renderer().style()->isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading; |
| boxHeight -= (topRubyBaseLeading + bottomRubyBaseLeading); |
| } |
| } |
| if (curr->isInlineTextBox()) { |
| TextEmphasisPosition emphasisMarkPosition; |
| - if (toInlineTextBox(curr)->getEmphasisMarkPosition(curr->renderer()->style(isFirstLineStyle()), emphasisMarkPosition)) { |
| + if (toInlineTextBox(curr)->getEmphasisMarkPosition(curr->renderer().style(isFirstLineStyle()), emphasisMarkPosition)) { |
| bool emphasisMarkIsOver = emphasisMarkPosition == TextEmphasisPositionOver; |
| - if (emphasisMarkIsOver != curr->renderer()->style(isFirstLineStyle())->isFlippedLinesWritingMode()) |
| + if (emphasisMarkIsOver != curr->renderer().style(isFirstLineStyle())->isFlippedLinesWritingMode()) |
| hasAnnotationsBefore = true; |
| else |
| hasAnnotationsAfter = true; |
| @@ -723,7 +726,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei |
| lineBottomIncludingMargins = max(lineBottom, lineBottomIncludingMargins); |
| } |
| - if (renderer()->style()->isFlippedLinesWritingMode()) |
| + if (renderer().style()->isFlippedLinesWritingMode()) |
| flipLinesInBlockDirection(lineTopIncludingMargins, lineBottomIncludingMargins); |
| } |
| } |
| @@ -731,7 +734,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei |
| void InlineFlowBox::computeMaxLogicalTop(float& maxLogicalTop) const |
| { |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| if (descendantsHaveSameLineHeightAndBaseline()) |
| @@ -751,7 +754,7 @@ void InlineFlowBox::flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lin |
| setLogicalTop(lineBottom - (logicalTop() - lineTop) - logicalHeight()); |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders aren't affected here. |
| if (curr->isInlineFlowBox()) |
| @@ -767,7 +770,7 @@ inline void InlineFlowBox::addBoxShadowVisualOverflow(LayoutRect& logicalVisualO |
| if (!parent()) |
| return; |
| - RenderStyle* style = renderer()->style(isFirstLineStyle()); |
| + RenderStyle* style = renderer().style(isFirstLineStyle()); |
| if (!style->boxShadow()) |
| return; |
| @@ -800,7 +803,7 @@ inline void InlineFlowBox::addBorderOutsetVisualOverflow(LayoutRect& logicalVisu |
| if (!parent()) |
| return; |
| - RenderStyle* style = renderer()->style(isFirstLineStyle()); |
| + RenderStyle* style = renderer().style(isFirstLineStyle()); |
| if (!style->hasBorderImageOutsets()) |
| return; |
| @@ -834,7 +837,7 @@ inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox* textBox, Glyp |
| if (textBox->knownToHaveNoOverflow()) |
| return; |
| - RenderStyle* style = textBox->renderer()->style(isFirstLineStyle()); |
| + RenderStyle* style = textBox->renderer().style(isFirstLineStyle()); |
| GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(textBox); |
| GlyphOverflow* glyphOverflow = it == textBoxDataMap.end() ? 0 : &it->value.second; |
| @@ -891,13 +894,13 @@ inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox* textBox, Glyp |
| inline void InlineFlowBox::addReplacedChildOverflow(const InlineBox* inlineBox, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow) |
| { |
| - RenderBox* box = toRenderBox(inlineBox->renderer()); |
| + RenderBox* box = &toRenderBox(inlineBox->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderBox& box = toRenderBox(inlineBox->renderer()
ostap
2014/02/28 08:29:14
Done.
|
| // Visual overflow only propagates if the box doesn't have a self-painting layer. This rectangle does not include |
| // transforms or relative positioning (since those objects always have self-painting layers), but it does need to be adjusted |
| // for writing-mode differences. |
| if (!box->hasSelfPaintingLayer()) { |
| - LayoutRect childLogicalVisualOverflow = box->logicalVisualOverflowRectForPropagation(renderer()->style()); |
| + LayoutRect childLogicalVisualOverflow = box->logicalVisualOverflowRectForPropagation(renderer().style()); |
| childLogicalVisualOverflow.move(inlineBox->logicalLeft(), inlineBox->logicalTop()); |
| logicalVisualOverflow.unite(childLogicalVisualOverflow); |
| } |
| @@ -905,7 +908,7 @@ inline void InlineFlowBox::addReplacedChildOverflow(const InlineBox* inlineBox, |
| // Layout overflow internal to the child box only propagates if the child box doesn't have overflow clip set. |
| // Otherwise the child border box propagates as layout overflow. This rectangle must include transforms and relative positioning |
| // and be adjusted for writing-mode differences. |
| - LayoutRect childLogicalLayoutOverflow = box->logicalLayoutOverflowRectForPropagation(renderer()->style()); |
| + LayoutRect childLogicalLayoutOverflow = box->logicalLayoutOverflowRectForPropagation(renderer().style()); |
| childLogicalLayoutOverflow.move(inlineBox->logicalLeft(), inlineBox->logicalTop()); |
| logicalLayoutOverflow.unite(childLogicalLayoutOverflow); |
| } |
| @@ -926,18 +929,18 @@ void InlineFlowBox::computeOverflow(LayoutUnit lineTop, LayoutUnit lineBottom, G |
| addBorderOutsetVisualOverflow(logicalVisualOverflow); |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| - if (curr->renderer()->isText()) { |
| + if (curr->renderer().isText()) { |
| InlineTextBox* text = toInlineTextBox(curr); |
| - RenderText* rt = toRenderText(text->renderer()); |
| + RenderText* rt = &toRenderText(text->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderText& rt = toRenderText(text->renderer());
ostap
2014/02/28 08:29:14
Done.
|
| if (rt->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()) |
| @@ -945,8 +948,9 @@ void InlineFlowBox::computeOverflow(LayoutUnit lineTop, LayoutUnit lineBottom, G |
| LayoutRect childLayoutOverflow = flow->logicalLayoutOverflowRect(lineTop, lineBottom); |
| childLayoutOverflow.move(flow->boxModelObject()->relativePositionLogicalOffset()); |
| logicalLayoutOverflow.unite(childLayoutOverflow); |
| - } else |
| + } else { |
| addReplacedChildOverflow(curr, logicalLayoutOverflow, logicalVisualOverflow); |
| + } |
| } |
| setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, lineTop, lineBottom); |
| @@ -997,19 +1001,19 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re |
| // We need to account for culled inline parents of the hit-tested nodes, so that they may also get included in area-based hit-tests. |
| RenderObject* culledParent = 0; |
| for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) { |
| - if (curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) { |
| + if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) { |
| RenderObject* newParent = 0; |
| // Culled parents are only relevant for area-based hit-tests, so ignore it in point-based ones. |
| if (locationInContainer.isRectBasedTest()) { |
| - newParent = curr->renderer()->parent(); |
| - if (newParent == renderer()) |
| + newParent = curr->renderer().parent(); |
| + if (newParent == &renderer()) |
| newParent = 0; |
| } |
| // Check the culled parent after all its children have been checked, to do this we wait until |
| // we are about to test an element with a different parent. |
| if (newParent != culledParent) { |
| if (!newParent || !newParent->isDescendantOf(culledParent)) { |
| - while (culledParent && culledParent != renderer() && culledParent != newParent) { |
| + while (culledParent && culledParent != &renderer() && culledParent != newParent) { |
| if (culledParent->isRenderInline() && toRenderInline(culledParent)->hitTestCulledInline(request, result, locationInContainer, accumulatedOffset)) |
| return true; |
| culledParent = culledParent->parent(); |
| @@ -1018,13 +1022,13 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re |
| culledParent = newParent; |
| } |
| if (curr->nodeAtPoint(request, result, locationInContainer, accumulatedOffset, lineTop, lineBottom)) { |
| - renderer()->updateHitTestResult(result, locationInContainer.point() - toLayoutSize(accumulatedOffset)); |
| + renderer().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(accumulatedOffset)); |
| return true; |
| } |
| } |
| } |
| // Check any culled ancestor of the final children tested. |
| - while (culledParent && culledParent != renderer()) { |
| + while (culledParent && culledParent != &renderer()) { |
| if (culledParent->isRenderInline() && toRenderInline(culledParent)->hitTestCulledInline(request, result, locationInContainer, accumulatedOffset)) |
| return true; |
| culledParent = culledParent->parent(); |
| @@ -1038,7 +1042,7 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re |
| LayoutUnit height = frameRect.height(); |
| // Constrain our hit testing to the line top and bottom if necessary. |
| - bool noQuirksMode = renderer()->document().inNoQuirksMode(); |
| + bool noQuirksMode = renderer().document().inNoQuirksMode(); |
| if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) { |
| RootInlineBox* rootBox = root(); |
| LayoutUnit& top = isHorizontal() ? minY : minX; |
| @@ -1054,8 +1058,8 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re |
| rect.moveBy(accumulatedOffset); |
| if (visibleToHitTestRequest(request) && locationInContainer.intersects(rect)) { |
| - renderer()->updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - toLayoutSize(accumulatedOffset))); // Don't add in m_x or m_y here, we want coords in the containing block's space. |
| - if (!result.addNodeToRectBasedTestResult(renderer()->node(), request, locationInContainer, rect)) |
| + renderer().updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - toLayoutSize(accumulatedOffset))); // Don't add in m_x or m_y here, we want coords in the containing block's space. |
| + if (!result.addNodeToRectBasedTestResult(renderer().node(), request, locationInContainer, rect)) |
| return true; |
| } |
| @@ -1065,7 +1069,7 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re |
| void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom) |
| { |
| LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); |
| - overflowRect.inflate(renderer()->maximalOutlineSize(paintInfo.phase)); |
| + overflowRect.inflate(renderer().maximalOutlineSize(paintInfo.phase)); |
| flipForWritingMode(overflowRect); |
| overflowRect.moveBy(paintOffset); |
| @@ -1076,8 +1080,8 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, |
| if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) { |
| // Add ourselves to the paint info struct's list of inlines that need to paint their |
| // outlines. |
| - if (renderer()->style()->visibility() == VISIBLE && renderer()->hasOutline() && !isRootInlineBox()) { |
| - RenderInline* inlineFlow = toRenderInline(renderer()); |
| + if (renderer().style()->visibility() == VISIBLE && renderer().hasOutline() && !isRootInlineBox()) { |
| + RenderInline* inlineFlow = &toRenderInline(renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderInline& inlineFlow = toRenderInline(renderer
ostap
2014/02/28 08:29:14
Done.
|
| RenderBlock* cb = 0; |
| bool containingBlockPaintsContinuationOutline = inlineFlow->continuation() || inlineFlow->isInlineElementContinuation(); |
| @@ -1085,7 +1089,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, |
| // FIXME: See https://bugs.webkit.org/show_bug.cgi?id=54690. We currently don't reconnect inline continuations |
| // after a child removal. As a result, those merged inlines do not get seperated and hence not get enclosed by |
| // anonymous blocks. In this case, it is better to bail out and paint it ourself. |
| - RenderBlock* enclosingAnonymousBlock = renderer()->containingBlock(); |
| + RenderBlock* enclosingAnonymousBlock = renderer().containingBlock(); |
| if (!enclosingAnonymousBlock->isAnonymousBlock()) |
| containingBlockPaintsContinuationOutline = false; |
| else { |
| @@ -1102,7 +1106,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, |
| if (containingBlockPaintsContinuationOutline) { |
| // Add ourselves to the containing block of the entire continuation so that it can |
| // paint us atomically. |
| - cb->addContinuationWithOutline(toRenderInline(renderer()->node()->renderer())); |
| + cb->addContinuationWithOutline(toRenderInline(renderer().node()->renderer())); |
| } else if (!inlineFlow->isInlineElementContinuation()) { |
| paintInfo.outlineObjects()->add(inlineFlow); |
| } |
| @@ -1122,12 +1126,12 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, |
| PaintPhase paintPhase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhaseOutline : paintInfo.phase; |
| PaintInfo childInfo(paintInfo); |
| childInfo.phase = paintPhase; |
| - childInfo.updatePaintingRootForChildren(renderer()); |
| + childInfo.updatePaintingRootForChildren(&renderer()); |
| // Paint our children. |
| if (paintPhase != PaintPhaseSelfOutline) { |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) |
| + if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) |
| curr->paint(childInfo, paintOffset, lineTop, lineBottom); |
| } |
| } |
| @@ -1146,17 +1150,17 @@ bool InlineFlowBox::boxShadowCanBeAppliedToBackground(const FillLayer& lastBackg |
| // The checks here match how paintFillLayer() decides whether to clip (if it does, the shadow |
| // would be clipped out, so it has to be drawn separately). |
| StyleImage* image = lastBackgroundLayer.image(); |
| - bool hasFillImage = image && image->canRender(renderer(), renderer()->style()->effectiveZoom()); |
| - return (!hasFillImage && !renderer()->style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent(); |
| + bool hasFillImage = image && image->canRender(&renderer(), renderer().style()->effectiveZoom()); |
| + return (!hasFillImage && !renderer().style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent(); |
| } |
| void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op) |
| { |
| StyleImage* img = fillLayer->image(); |
| - bool hasFillImage = img && img->canRender(renderer(), renderer()->style()->effectiveZoom()); |
| - if ((!hasFillImage && !renderer()->style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent()) |
| + bool hasFillImage = img && img->canRender(&renderer(), renderer().style()->effectiveZoom()); |
| + if ((!hasFillImage && !renderer().style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent()) { |
| boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op); |
| - else if (renderer()->style()->boxDecorationBreak() == DCLONE) { |
| + } else if (renderer().style()->boxDecorationBreak() == DCLONE) { |
| GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), width(), height())); |
| boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op); |
| @@ -1169,7 +1173,7 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, c |
| // the previous line left off. |
| LayoutUnit logicalOffsetOnLine = 0; |
| LayoutUnit totalLogicalWidth; |
| - if (renderer()->style()->direction() == LTR) { |
| + if (renderer().style()->direction() == LTR) { |
| for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox()) |
| logicalOffsetOnLine += curr->logicalWidth(); |
| totalLogicalWidth = logicalOffsetOnLine; |
| @@ -1206,7 +1210,7 @@ void InlineFlowBox::paintBoxShadow(const PaintInfo& info, RenderStyle* s, Shadow |
| void InlineFlowBox::constrainToLineTopAndBottomIfNeeded(LayoutRect& rect) const |
| { |
| - bool noQuirksMode = renderer()->document().inNoQuirksMode(); |
| + bool noQuirksMode = renderer().document().inNoQuirksMode(); |
| if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) { |
| const RootInlineBox* rootBox = root(); |
| LayoutUnit logicalTop = isHorizontal() ? rect.y() : rect.x(); |
| @@ -1227,7 +1231,7 @@ void InlineFlowBox::constrainToLineTopAndBottomIfNeeded(LayoutRect& rect) const |
| static LayoutRect clipRectForNinePieceImageStrip(InlineFlowBox* box, const NinePieceImage& image, const LayoutRect& paintRect) |
| { |
| LayoutRect clipRect(paintRect); |
| - RenderStyle* style = box->renderer()->style(); |
| + RenderStyle* style = box->renderer().style(); |
| LayoutBoxExtent outsets = style->imageOutsets(image); |
| if (box->isHorizontal()) { |
| clipRect.setY(paintRect.y() - outsets.top()); |
| @@ -1253,7 +1257,7 @@ static LayoutRect clipRectForNinePieceImageStrip(InlineFlowBox* box, const NineP |
| void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| { |
| - if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground) |
| + if (!paintInfo.shouldPaintWithinRoot(&renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground) |
| return; |
| // Pixel snap background/border painting. |
| @@ -1270,30 +1274,30 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& |
| // You can use p::first-line to specify a background. If so, the root line boxes for |
| // a line may actually have to paint a background. |
| - RenderStyle* styleToUse = renderer()->style(isFirstLineStyle()); |
| - if ((!parent() && isFirstLineStyle() && styleToUse != renderer()->style()) || (parent() && renderer()->hasBoxDecorations())) { |
| + RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); |
| + if ((!parent() && isFirstLineStyle() && styleToUse != renderer().style()) || (parent() && renderer().hasBoxDecorations())) { |
| LayoutRect paintRect = LayoutRect(adjustedPaintoffset, frameRect.size()); |
| // Shadow comes first and is behind the background and border. |
| if (!boxModelObject()->boxShadowShouldBeAppliedToBackground(BackgroundBleedNone, this)) |
| paintBoxShadow(paintInfo, styleToUse, Normal, paintRect); |
| - Color c = renderer()->resolveColor(styleToUse, CSSPropertyBackgroundColor); |
| + Color c = renderer().resolveColor(styleToUse, CSSPropertyBackgroundColor); |
| paintFillLayers(paintInfo, c, styleToUse->backgroundLayers(), paintRect); |
| paintBoxShadow(paintInfo, styleToUse, Inset, paintRect); |
| // :first-line cannot be used to put borders on a line. Always paint borders with our |
| // non-first-line style. |
| - if (parent() && renderer()->style()->hasBorder()) { |
| - const NinePieceImage& borderImage = renderer()->style()->borderImage(); |
| + if (parent() && renderer().style()->hasBorder()) { |
| + const NinePieceImage& borderImage = renderer().style()->borderImage(); |
| StyleImage* borderImageSource = borderImage.image(); |
| - bool hasBorderImage = borderImageSource && borderImageSource->canRender(renderer(), styleToUse->effectiveZoom()); |
| + bool hasBorderImage = borderImageSource && borderImageSource->canRender(&renderer(), styleToUse->effectiveZoom()); |
| if (hasBorderImage && !borderImageSource->isLoaded()) |
| return; // Don't paint anything while we wait for the image to load. |
| // The simple case is where we either have no border image or we are the only box for this object. In those |
| // cases only a single call to draw is required. |
| if (!hasBorderImage || (!prevLineBox() && !nextLineBox())) |
| - boxModelObject()->paintBorder(paintInfo, paintRect, renderer()->style(isFirstLineStyle()), BackgroundBleedNone, includeLogicalLeftEdge(), includeLogicalRightEdge()); |
| + boxModelObject()->paintBorder(paintInfo, paintRect, renderer().style(isFirstLineStyle()), BackgroundBleedNone, includeLogicalLeftEdge(), includeLogicalRightEdge()); |
| else { |
| // We have a border image that spans multiple lines. |
| // We need to adjust tx and ty by the width of all previous lines. |
| @@ -1317,7 +1321,7 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& |
| LayoutRect clipRect = clipRectForNinePieceImageStrip(this, borderImage, paintRect); |
| GraphicsContextStateSaver stateSaver(*context); |
| context->clip(clipRect); |
| - boxModelObject()->paintBorder(paintInfo, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(isFirstLineStyle())); |
| + boxModelObject()->paintBorder(paintInfo, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(isFirstLineStyle())); |
| } |
| } |
| } |
| @@ -1325,7 +1329,7 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& |
| void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| { |
| - if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) |
| + if (!paintInfo.shouldPaintWithinRoot(&renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) |
| return; |
| // Pixel snap mask painting. |
| @@ -1338,16 +1342,16 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs |
| flipForWritingMode(localRect); |
| LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); |
| - const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage(); |
| - StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image(); |
| + const NinePieceImage& maskNinePieceImage = renderer().style()->maskBoxImage(); |
| + StyleImage* maskBoxImage = renderer().style()->maskBoxImage().image(); |
| // Figure out if we need to push a transparency layer to render our mask. |
| bool pushTransparencyLayer = false; |
| - bool compositedMask = renderer()->hasLayer() && boxModelObject()->layer()->hasCompositedMask(); |
| - bool flattenCompositingLayers = renderer()->view()->frameView() && renderer()->view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; |
| + bool compositedMask = renderer().hasLayer() && boxModelObject()->layer()->hasCompositedMask(); |
| + bool flattenCompositingLayers = renderer().view()->frameView() && renderer().view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; |
| CompositeOperator compositeOp = CompositeSourceOver; |
| if (!compositedMask || flattenCompositingLayers) { |
| - if ((maskBoxImage && renderer()->style()->maskLayers()->hasImage()) || renderer()->style()->maskLayers()->next()) |
| + if ((maskBoxImage && renderer().style()->maskLayers()->hasImage()) || renderer().style()->maskLayers()->next()) |
| pushTransparencyLayer = true; |
| compositeOp = CompositeDestinationIn; |
| @@ -1359,9 +1363,9 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs |
| } |
| LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); |
| - paintFillLayers(paintInfo, Color::transparent, renderer()->style()->maskLayers(), paintRect, compositeOp); |
| + paintFillLayers(paintInfo, Color::transparent, renderer().style()->maskLayers(), paintRect, compositeOp); |
| - bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer(), renderer()->style()->effectiveZoom()); |
| + bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(&renderer(), renderer().style()->effectiveZoom()); |
| if (!hasBoxImage || !maskBoxImage->isLoaded()) { |
| if (pushTransparencyLayer) |
| paintInfo.context->endLayer(); |
| @@ -1371,7 +1375,7 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs |
| // The simple case is where we are the only box for this object. In those |
| // cases only a single call to draw is required. |
| if (!prevLineBox() && !nextLineBox()) { |
| - boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp); |
| + boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer().style(), maskNinePieceImage, compositeOp); |
| } else { |
| // We have a mask image that spans multiple lines. |
| // We need to adjust _tx and _ty by the width of all previous lines. |
| @@ -1389,7 +1393,7 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs |
| LayoutRect clipRect = clipRectForNinePieceImageStrip(this, maskNinePieceImage, paintRect); |
| GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| paintInfo.context->clip(clipRect); |
| - boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp); |
| + boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(), maskNinePieceImage, compositeOp); |
| } |
| if (pushTransparencyLayer) |
| @@ -1466,14 +1470,14 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi |
| { |
| LayoutUnit result = 0; |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| if (curr->isInlineFlowBox()) |
| result = max(result, toInlineFlowBox(curr)->computeOverAnnotationAdjustment(allowedPosition)); |
| - if (curr->renderer()->isReplaced() && curr->renderer()->isRubyRun() && curr->renderer()->style()->rubyPosition() == RubyPositionBefore) { |
| - RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer()); |
| + if (curr->renderer().isReplaced() && curr->renderer().isRubyRun() && curr->renderer().style()->rubyPosition() == RubyPositionBefore) { |
| + RenderRubyRun* rubyRun = &toRenderRubyRun(curr->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderRubyRun& rubyRun = toRenderRubyRun(curr->ren
ostap
2014/02/28 08:29:14
Done.
|
| RenderRubyText* rubyText = rubyRun->rubyText(); |
| if (!rubyText) |
| continue; |
| @@ -1494,7 +1498,7 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi |
| } |
| if (curr->isInlineTextBox()) { |
| - RenderStyle* style = curr->renderer()->style(isFirstLineStyle()); |
| + RenderStyle* style = curr->renderer().style(isFirstLineStyle()); |
| TextEmphasisPosition emphasisMarkPosition; |
| if (style->textEmphasisMark() != TextEmphasisMarkNone && toInlineTextBox(curr)->getEmphasisMarkPosition(style, emphasisMarkPosition) && emphasisMarkPosition == TextEmphasisPositionOver) { |
| if (!style->isFlippedLinesWritingMode()) { |
| @@ -1514,14 +1518,14 @@ LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPos |
| { |
| LayoutUnit result = 0; |
| for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| - if (curr->renderer()->isOutOfFlowPositioned()) |
| + if (curr->renderer().isOutOfFlowPositioned()) |
| continue; // Positioned placeholders don't affect calculations. |
| if (curr->isInlineFlowBox()) |
| result = max(result, toInlineFlowBox(curr)->computeUnderAnnotationAdjustment(allowedPosition)); |
| - if (curr->renderer()->isReplaced() && curr->renderer()->isRubyRun() && curr->renderer()->style()->rubyPosition() == RubyPositionAfter) { |
| - RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer()); |
| + if (curr->renderer().isReplaced() && curr->renderer().isRubyRun() && curr->renderer().style()->rubyPosition() == RubyPositionAfter) { |
| + RenderRubyRun* rubyRun = &toRenderRubyRun(curr->renderer()); |
|
Inactive
2014/02/28 02:28:19
RenderRubyRun& rubyRun = toRenderRubyRun(curr->ren
ostap
2014/02/28 08:29:14
Done.
|
| RenderRubyText* rubyText = rubyRun->rubyText(); |
| if (!rubyText) |
| continue; |
| @@ -1542,7 +1546,7 @@ LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPos |
| } |
| if (curr->isInlineTextBox()) { |
| - RenderStyle* style = curr->renderer()->style(isFirstLineStyle()); |
| + RenderStyle* style = curr->renderer().style(isFirstLineStyle()); |
| if (style->textEmphasisMark() != TextEmphasisMarkNone && style->textEmphasisPosition() == TextEmphasisPositionUnder) { |
| if (!style->isFlippedLinesWritingMode()) { |
| LayoutUnit bottomOfEmphasisMark = curr->logicalBottom() + style->font().emphasisMarkHeight(style->textEmphasisMarkString()); |
| @@ -1573,7 +1577,7 @@ void InlineFlowBox::collectLeafBoxesInLogicalOrder(Vector<InlineBox*>& leafBoxes |
| leafBoxesInLogicalOrder.append(leaf); |
| } |
| - if (renderer()->style()->rtlOrdering() == VisualOrder) |
| + if (renderer().style()->rtlOrdering() == VisualOrder) |
| return; |
| // Reverse of reordering of the line (L2 according to Bidi spec): |