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

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: 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
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) 154 static void updateStyleOfAnonymousBlockContinuations(LayoutObject* block, const ComputedStyle& newStyle, const ComputedStyle& oldStyle)
155 { 155 {
156 for (;block && block->isAnonymousBlock(); block = block->nextSibling()) { 156 for (;block && block->isAnonymousBlock(); block = block->nextSibling()) {
157 if (!toLayoutBlock(block)->isAnonymousBlockContinuation()) 157 if (!toLayoutBlock(block)->isAnonymousBlockContinuation())
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 } 1124 }
1125 1125
1126 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paint InvalidationState); 1126 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paint InvalidationState);
1127 } 1127 }
1128 1128
1129 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const 1129 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const
1130 { 1130 {
1131 ASSERT(container == this->container()); 1131 ASSERT(container == this->container());
1132 1132
1133 LayoutSize offset; 1133 LayoutSize offset;
1134 if (isRelPositioned()) 1134 if (isInFlowPositioned())
1135 offset += offsetForInFlowPosition(); 1135 offset += offsetForInFlowPosition();
1136 1136
1137 offset += container->columnOffset(point); 1137 offset += container->columnOffset(point);
1138 1138
1139 if (container->hasOverflowClip()) 1139 if (container->hasOverflowClip())
1140 offset -= toLayoutBox(container)->scrolledContentOffset(); 1140 offset -= toLayoutBox(container)->scrolledContentOffset();
1141 1141
1142 if (offsetDependsOnPoint) 1142 if (offsetDependsOnPoint)
1143 *offsetDependsOnPoint = (container->isBox() && container->style()->isFli ppedBlocksWritingMode()) || container->isLayoutFlowThread(); 1143 *offsetDependsOnPoint = (container->isBox() && container->style()->isFli ppedBlocksWritingMode()) || container->isLayoutFlowThread();
1144 1144
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 { 1294 {
1295 ASSERT(linePositionMode == PositionOnContainingLine); 1295 ASSERT(linePositionMode == PositionOnContainingLine);
1296 const FontMetrics& fontMetrics = style(firstLine)->fontMetrics(); 1296 const FontMetrics& fontMetrics = style(firstLine)->fontMetrics();
1297 return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2; 1297 return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
1298 } 1298 }
1299 1299
1300 LayoutSize LayoutInline::offsetForInFlowPositionedInline(const LayoutBox& child) const 1300 LayoutSize LayoutInline::offsetForInFlowPositionedInline(const LayoutBox& child) const
1301 { 1301 {
1302 // FIXME: This function isn't right with mixed writing modes. 1302 // FIXME: This function isn't right with mixed writing modes.
1303 1303
1304 ASSERT(isRelPositioned()); 1304 ASSERT(isInFlowPositioned());
1305 if (!isRelPositioned()) 1305 if (!isInFlowPositioned())
1306 return LayoutSize(); 1306 return LayoutSize();
1307 1307
1308 // When we have an enclosing relpositioned inline, we need to add in the off set of the first line 1308 // When we have an enclosing relpositioned inline, we need to add in the off set of the first line
1309 // box from the rest of the content, but only in the cases where we know we' re positioned 1309 // box from the rest of the content, but only in the cases where we know we' re positioned
1310 // relative to the inline itself. 1310 // relative to the inline itself.
1311 1311
1312 LayoutSize logicalOffset; 1312 LayoutSize logicalOffset;
1313 LayoutUnit inlinePosition; 1313 LayoutUnit inlinePosition;
1314 LayoutUnit blockPosition; 1314 LayoutUnit blockPosition;
1315 if (firstLineBox()) { 1315 if (firstLineBox()) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 } 1428 }
1429 1429
1430 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const 1430 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const
1431 { 1431 {
1432 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r); 1432 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r);
1433 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1433 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1434 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); 1434 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box);
1435 } 1435 }
1436 1436
1437 } // namespace blink 1437 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698