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

Side by Side Diff: Source/core/layout/LayoutBlock.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/css/parser/CSSParserFastPaths.cpp ('k') | Source/core/layout/LayoutBlockFlow.cpp » ('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 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 PaintInvalidationState disabledPaintInvalidationState(childPaint InvalidationState, *this, paintInvalidationContainerForChild); 324 PaintInvalidationState disabledPaintInvalidationState(childPaint InvalidationState, *this, paintInvalidationContainerForChild);
325 box->invalidateTreeIfNeeded(disabledPaintInvalidationState); 325 box->invalidateTreeIfNeeded(disabledPaintInvalidationState);
326 continue; 326 continue;
327 } 327 }
328 328
329 // If the positioned layoutObject is absolutely positioned and it is inside 329 // If the positioned layoutObject is absolutely positioned and it is inside
330 // a relatively positioned inline element, we need to account for 330 // a relatively positioned inline element, we need to account for
331 // the inline elements position in PaintInvalidationState. 331 // the inline elements position in PaintInvalidationState.
332 if (box->style()->position() == AbsolutePosition) { 332 if (box->style()->position() == AbsolutePosition) {
333 LayoutObject* container = box->container(&paintInvalidationConta inerForChild, 0); 333 LayoutObject* container = box->container(&paintInvalidationConta inerForChild, 0);
334 if (container->isRelPositioned() && container->isLayoutInline()) { 334 if (container->isInFlowPositioned() && container->isLayoutInline ()) {
335 // FIXME: We should be able to use PaintInvalidationState fo r this. 335 // FIXME: We should be able to use PaintInvalidationState fo r this.
336 // Currently, we will place absolutely positioned elements i nside 336 // Currently, we will place absolutely positioned elements i nside
337 // relatively positioned inline blocks in the wrong location . crbug.com/371485 337 // relatively positioned inline blocks in the wrong location . crbug.com/371485
338 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInva lidationState); 338 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInva lidationState);
339 PaintInvalidationState disabledPaintInvalidationState(childP aintInvalidationState, *this, paintInvalidationContainerForChild); 339 PaintInvalidationState disabledPaintInvalidationState(childP aintInvalidationState, *this, paintInvalidationContainerForChild);
340 box->invalidateTreeIfNeeded(disabledPaintInvalidationState); 340 box->invalidateTreeIfNeeded(disabledPaintInvalidationState);
341 continue; 341 continue;
342 } 342 }
343 } 343 }
344 344
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 return !ancestor || !ancestor->parent() || (ancestor->hasLayer() && ancestor ->parent()->isLayoutView()) 1761 return !ancestor || !ancestor->parent() || (ancestor->hasLayer() && ancestor ->parent()->isLayoutView())
1762 || ancestor->nonPseudoNode()->hasEditableStyle() == child->nonPseudoNode ()->hasEditableStyle(); 1762 || ancestor->nonPseudoNode()->hasEditableStyle() == child->nonPseudoNode ()->hasEditableStyle();
1763 } 1763 }
1764 1764
1765 // FIXME: This function should go on LayoutObject as an instance method. Then 1765 // FIXME: This function should go on LayoutObject as an instance method. Then
1766 // all cases in which positionForPoint recurs could call this instead to 1766 // all cases in which positionForPoint recurs could call this instead to
1767 // prevent crossing editable boundaries. This would require many tests. 1767 // prevent crossing editable boundaries. This would require many tests.
1768 static PositionWithAffinity positionForPointRespectingEditingBoundaries(LayoutBl ock* parent, LayoutBox* child, const LayoutPoint& pointInParentCoordinates) 1768 static PositionWithAffinity positionForPointRespectingEditingBoundaries(LayoutBl ock* parent, LayoutBox* child, const LayoutPoint& pointInParentCoordinates)
1769 { 1769 {
1770 LayoutPoint childLocation = child->location(); 1770 LayoutPoint childLocation = child->location();
1771 if (child->isRelPositioned()) 1771 if (child->isInFlowPositioned())
1772 childLocation += child->offsetForInFlowPosition(); 1772 childLocation += child->offsetForInFlowPosition();
1773 1773
1774 // FIXME: This is wrong if the child's writing-mode is different from the pa rent's. 1774 // FIXME: This is wrong if the child's writing-mode is different from the pa rent's.
1775 LayoutPoint pointInChildCoordinates(toLayoutPoint(pointInParentCoordinates - childLocation)); 1775 LayoutPoint pointInChildCoordinates(toLayoutPoint(pointInParentCoordinates - childLocation));
1776 1776
1777 // If this is an anonymous layoutObject, we just recur normally 1777 // If this is an anonymous layoutObject, we just recur normally
1778 Node* childNode = child->nonPseudoNode(); 1778 Node* childNode = child->nonPseudoNode();
1779 if (!childNode) 1779 if (!childNode)
1780 return child->positionForPoint(pointInChildCoordinates); 1780 return child->positionForPoint(pointInChildCoordinates);
1781 1781
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2890 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2891 { 2891 {
2892 showLayoutObject(); 2892 showLayoutObject();
2893 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2893 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2894 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2894 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2895 } 2895 }
2896 2896
2897 #endif 2897 #endif
2898 2898
2899 } // namespace blink 2899 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSParserFastPaths.cpp ('k') | Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698