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

Side by Side Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style errors and remaining layout tests. Created 5 years, 3 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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections. 189 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections.
190 if (style.hasAutoZIndex() && ((e && e->document().documentElement() == e) 190 if (style.hasAutoZIndex() && ((e && e->document().documentElement() == e)
191 || style.hasOpacity() 191 || style.hasOpacity()
192 || style.hasTransformRelatedProperty() 192 || style.hasTransformRelatedProperty()
193 || style.hasMask() 193 || style.hasMask()
194 || style.clipPath() 194 || style.clipPath()
195 || style.boxReflect() 195 || style.boxReflect()
196 || style.hasFilter() 196 || style.hasFilter()
197 || style.hasBlendMode() 197 || style.hasBlendMode()
198 || style.hasIsolation() 198 || style.hasIsolation()
199 || style.position() == FixedPosition 199 || style.hasViewportConstrainedPosition()
200 || isInTopLayer(e, style) 200 || isInTopLayer(e, style)
201 || hasWillChangeThatCreatesStackingContext(style))) 201 || hasWillChangeThatCreatesStackingContext(style)))
202 style.setZIndex(0); 202 style.setZIndex(0);
203 203
204 if (doesNotInheritTextDecoration(style, e)) 204 if (doesNotInheritTextDecoration(style, e))
205 style.clearAppliedTextDecorations(); 205 style.clearAppliedTextDecorations();
206 206
207 style.applyTextDecorations(); 207 style.applyTextDecorations();
208 208
209 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) 209 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE)
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 style.setDisplay(INLINE_BLOCK); 456 style.setDisplay(INLINE_BLOCK);
457 457
458 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells. 458 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells.
459 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock() 459 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock()
460 // on some sites). 460 // on some sites).
461 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP 461 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP
462 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW ) 462 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW )
463 && style.position() == RelativePosition) 463 && style.position() == RelativePosition)
464 style.setPosition(StaticPosition); 464 style.setPosition(StaticPosition);
465 465
466 // Cannot support position: sticky for table columns and column groups becau se current code is only doing
467 // background painting through columns / column groups
468 if ((style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_COLUM N)
469 && style.position() == StickyPosition)
470 style.setPosition(StaticPosition);
471
466 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns. 472 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns.
467 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though. 473 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though.
468 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP 474 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP
469 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP 475 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP
470 || style.display() == TABLE_CELL) 476 || style.display() == TABLE_CELL)
471 style.setWritingMode(parentStyle.writingMode()); 477 style.setWritingMode(parentStyle.writingMode());
472 478
473 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting 479 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting
474 // of block-flow to anything other than TopToBottomWritingMode. 480 // of block-flow to anything other than TopToBottomWritingMode.
475 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. 481 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support.
476 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) 482 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX))
477 style.setWritingMode(TopToBottomWritingMode); 483 style.setWritingMode(TopToBottomWritingMode);
478 484
479 if (parentStyle.isDisplayFlexibleOrGridBox()) { 485 if (parentStyle.isDisplayFlexibleOrGridBox()) {
480 style.setFloating(NoFloat); 486 style.setFloating(NoFloat);
481 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); 487 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles));
482 } 488 }
483 } 489 }
484 490
485 } 491 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698