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

Side by Side Diff: Source/core/layout/LayoutInline.cpp

Issue 1212893005: Add position: sticky as supported position value when CSSStickyPosition is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merge, convert pixel to ref tests, and address comments. Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/layout/LayoutInline.h ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 setInline(true); 137 setInline(true);
138 138
139 // FIXME: Support transforms and reflections on inline flows someday. 139 // FIXME: Support transforms and reflections on inline flows someday.
140 setHasTransformRelatedProperty(false); 140 setHasTransformRelatedProperty(false);
141 setHasReflection(false); 141 setHasReflection(false);
142 } 142 }
143 143
144 static LayoutObject* inFlowPositionedInlineAncestor(LayoutObject* p) 144 static LayoutObject* inFlowPositionedInlineAncestor(LayoutObject* p)
145 { 145 {
146 while (p && p->isLayoutInline()) { 146 while (p && p->isLayoutInline()) {
147 if (p->isRelPositioned()) 147 if (p->isInFlowPositioned())
148 return p; 148 return p;
149 p = p->parent(); 149 p = p->parent();
150 } 150 }
151 return nullptr; 151 return nullptr;
152 } 152 }
153 153
154 static void updateStyleOfAnonymousBlockContinuations(LayoutObject* block, const ComputedStyle& newStyle, const ComputedStyle& oldStyle, LayoutObject* containing BlockOfEndOfContinuation) 154 static void updateStyleOfAnonymousBlockContinuations(LayoutObject* block, const ComputedStyle& newStyle, const ComputedStyle& oldStyle, LayoutObject* containing BlockOfEndOfContinuation)
155 { 155 {
156 // If an inline's outline or in-flow positioning has changed then any descen dant blocks will need to change their styles accordingly. 156 // If an inline's outline or in-flow positioning has changed then any descen dant blocks will need to change their styles accordingly.
157 bool updateOutline = !newStyle.isOutlineEquivalent(&oldStyle); 157 bool updateOutline = !newStyle.isOutlineEquivalent(&oldStyle);
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 } 1122 }
1123 1123
1124 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paint InvalidationState); 1124 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paint InvalidationState);
1125 } 1125 }
1126 1126
1127 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const 1127 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const
1128 { 1128 {
1129 ASSERT(container == this->container()); 1129 ASSERT(container == this->container());
1130 1130
1131 LayoutSize offset; 1131 LayoutSize offset;
1132 if (isRelPositioned()) 1132 if (isInFlowPositioned())
1133 offset += offsetForInFlowPosition(); 1133 offset += offsetForInFlowPosition();
1134 1134
1135 offset += container->columnOffset(point); 1135 offset += container->columnOffset(point);
1136 1136
1137 if (container->hasOverflowClip()) 1137 if (container->hasOverflowClip())
1138 offset -= toLayoutBox(container)->scrolledContentOffset(); 1138 offset -= toLayoutBox(container)->scrolledContentOffset();
1139 1139
1140 if (offsetDependsOnPoint) 1140 if (offsetDependsOnPoint)
1141 *offsetDependsOnPoint = (container->isBox() && container->style()->isFli ppedBlocksWritingMode()) || container->isLayoutFlowThread(); 1141 *offsetDependsOnPoint = (container->isBox() && container->style()->isFli ppedBlocksWritingMode()) || container->isLayoutFlowThread();
1142 1142
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 { 1292 {
1293 ASSERT(linePositionMode == PositionOnContainingLine); 1293 ASSERT(linePositionMode == PositionOnContainingLine);
1294 const FontMetrics& fontMetrics = style(firstLine)->fontMetrics(); 1294 const FontMetrics& fontMetrics = style(firstLine)->fontMetrics();
1295 return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2; 1295 return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
1296 } 1296 }
1297 1297
1298 LayoutSize LayoutInline::offsetForInFlowPositionedInline(const LayoutBox& child) const 1298 LayoutSize LayoutInline::offsetForInFlowPositionedInline(const LayoutBox& child) const
1299 { 1299 {
1300 // FIXME: This function isn't right with mixed writing modes. 1300 // FIXME: This function isn't right with mixed writing modes.
1301 1301
1302 ASSERT(isRelPositioned()); 1302 ASSERT(isInFlowPositioned());
1303 if (!isRelPositioned()) 1303 if (!isInFlowPositioned())
1304 return LayoutSize(); 1304 return LayoutSize();
1305 1305
1306 // When we have an enclosing relpositioned inline, we need to add in the off set of the first line 1306 // When we have an enclosing relpositioned inline, we need to add in the off set of the first line
1307 // box from the rest of the content, but only in the cases where we know we' re positioned 1307 // box from the rest of the content, but only in the cases where we know we' re positioned
1308 // relative to the inline itself. 1308 // relative to the inline itself.
1309 1309
1310 LayoutSize logicalOffset; 1310 LayoutSize logicalOffset;
1311 LayoutUnit inlinePosition; 1311 LayoutUnit inlinePosition;
1312 LayoutUnit blockPosition; 1312 LayoutUnit blockPosition;
1313 if (firstLineBox()) { 1313 if (firstLineBox()) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 } 1426 }
1427 1427
1428 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const 1428 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const
1429 { 1429 {
1430 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r); 1430 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r);
1431 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1431 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1432 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); 1432 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box);
1433 } 1433 }
1434 1434
1435 } // namespace blink 1435 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutInline.h ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698