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

Side by Side Diff: third_party/WebKit/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: Move compositor plumbing into a separate review. Created 5 years, 2 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections. 190 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections.
191 if (style.hasAutoZIndex() && ((e && e->document().documentElement() == e) 191 if (style.hasAutoZIndex() && ((e && e->document().documentElement() == e)
192 || style.hasOpacity() 192 || style.hasOpacity()
193 || style.hasTransformRelatedProperty() 193 || style.hasTransformRelatedProperty()
194 || style.hasMask() 194 || style.hasMask()
195 || style.clipPath() 195 || style.clipPath()
196 || style.boxReflect() 196 || style.boxReflect()
197 || style.hasFilter() 197 || style.hasFilter()
198 || style.hasBlendMode() 198 || style.hasBlendMode()
199 || style.hasIsolation() 199 || style.hasIsolation()
200 || style.position() == FixedPosition 200 || style.hasViewportConstrainedPosition()
201 || isInTopLayer(e, style) 201 || isInTopLayer(e, style)
202 || hasWillChangeThatCreatesStackingContext(style))) 202 || hasWillChangeThatCreatesStackingContext(style)))
203 style.setZIndex(0); 203 style.setZIndex(0);
204 204
205 if (doesNotInheritTextDecoration(style, e)) 205 if (doesNotInheritTextDecoration(style, e))
206 style.clearAppliedTextDecorations(); 206 style.clearAppliedTextDecorations();
207 207
208 style.applyTextDecorations(); 208 style.applyTextDecorations();
209 209
210 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) 210 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE)
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 style.setDisplay(INLINE_BLOCK); 457 style.setDisplay(INLINE_BLOCK);
458 458
459 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells. 459 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells.
460 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock() 460 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock()
461 // on some sites). 461 // on some sites).
462 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP 462 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP
463 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW ) 463 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW )
464 && style.position() == RelativePosition) 464 && style.position() == RelativePosition)
465 style.setPosition(StaticPosition); 465 style.setPosition(StaticPosition);
466 466
467 // Cannot support position: sticky for table columns and column groups becau se current code is only doing
468 // background painting through columns / column groups
chrishtr 2015/10/06 17:08:33 Is this recorded in a bug? According to this spec
flackr 2015/10/07 20:38:12 Hmm, doesn't look like it, just the bug for a cras
chrishtr 2015/11/04 01:40:43 The spec says: "The effect of position: sticky on
flackr 2015/11/25 21:03:01 There are many public examples where sticky is use
469 if ((style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_COLUM N)
470 && style.position() == StickyPosition)
471 style.setPosition(StaticPosition);
472
467 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns. 473 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns.
468 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though. 474 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though.
469 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP 475 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP
470 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP 476 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP
471 || style.display() == TABLE_CELL) 477 || style.display() == TABLE_CELL)
472 style.setWritingMode(parentStyle.writingMode()); 478 style.setWritingMode(parentStyle.writingMode());
473 479
474 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting 480 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting
475 // of block-flow to anything other than TopToBottomWritingMode. 481 // of block-flow to anything other than TopToBottomWritingMode.
476 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. 482 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support.
477 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) 483 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX))
478 style.setWritingMode(TopToBottomWritingMode); 484 style.setWritingMode(TopToBottomWritingMode);
479 485
480 if (parentStyle.isDisplayFlexibleOrGridBox()) { 486 if (parentStyle.isDisplayFlexibleOrGridBox()) {
481 style.setFloating(NoFloat); 487 style.setFloating(NoFloat);
482 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); 488 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles));
483 489
484 // We want to count vertical percentage paddings/margins on flex items b ecause our current 490 // We want to count vertical percentage paddings/margins on flex items b ecause our current
485 // behavior is different from the spec and we want to gather compatibili ty data. 491 // behavior is different from the spec and we want to gather compatibili ty data.
486 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) 492 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t())
487 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); 493 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical);
488 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) 494 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( ))
489 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); 495 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal);
490 } 496 }
491 } 497 }
492 498
493 } 499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698