Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1591)

Unified Diff: Source/core/rendering/InlineFlowBox.cpp

Issue 176953008: Include the outline into the visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/InlineFlowBox.cpp
diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp
index 66e89f3b5e07451a201aeafa4dd0e65654b1724f..2b1d06cf11789ad809cf009f6485426dd296b393 100644
--- a/Source/core/rendering/InlineFlowBox.cpp
+++ b/Source/core/rendering/InlineFlowBox.cpp
@@ -164,8 +164,9 @@ void InlineFlowBox::addToLine(InlineBox* child)
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()))
+ || (child->renderer()->isListMarker() && !toRenderListMarker(child->renderer())->isInside())
+ || child->renderer()->style(isFirstLineStyle())->hasBorderImageOutsets()
+ || child->renderer()->style(isFirstLineStyle())->hasOutline()))
child->clearKnownToHaveNoOverflow();
if (knownToHaveNoOverflow() && child->isInlineFlowBox() && !toInlineFlowBox(child)->knownToHaveNoOverflow())
@@ -829,6 +830,20 @@ inline void InlineFlowBox::addBorderOutsetVisualOverflow(LayoutRect& logicalVisu
logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow);
}
+inline void InlineFlowBox::addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow)
+{
+ // outline on root line boxes is applying to the block and not to the lines.
leviw_travelin_and_unemployed 2014/03/11 22:51:10 Nit: is applied.
Julien - ping for review 2014/03/12 03:18:58 Done.
+ if (!parent())
+ return;
+
+ RenderStyle* style = renderer()->style(isFirstLineStyle());
+ if (!style->hasOutline())
+ return;
+
+ unsigned short outlineSize = style->outlineSize();
+ logicalVisualOverflow.inflate(outlineSize);
+}
+
inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox* textBox, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, LayoutRect& logicalVisualOverflow)
{
if (textBox->knownToHaveNoOverflow())
@@ -924,6 +939,7 @@ void InlineFlowBox::computeOverflow(LayoutUnit lineTop, LayoutUnit lineBottom, G
addBoxShadowVisualOverflow(logicalVisualOverflow);
addBorderOutsetVisualOverflow(logicalVisualOverflow);
+ addOutlineVisualOverflow(logicalVisualOverflow);
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
if (curr->renderer()->isOutOfFlowPositioned())
@@ -1065,7 +1081,6 @@ 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));
flipForWritingMode(overflowRect);
overflowRect.moveBy(paintOffset);

Powered by Google App Engine
This is Rietveld 408576698