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

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: Force main thread scrolling, set experimental status, and address review comments. Created 5 years 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections. 194 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections.
195 if (style.hasAutoZIndex() && ((element && element->document().documentElemen t() == element) 195 if (style.hasAutoZIndex() && ((element && element->document().documentElemen t() == element)
196 || style.hasOpacity() 196 || style.hasOpacity()
197 || style.hasTransformRelatedProperty() 197 || style.hasTransformRelatedProperty()
198 || style.hasMask() 198 || style.hasMask()
199 || style.clipPath() 199 || style.clipPath()
200 || style.boxReflect() 200 || style.boxReflect()
201 || style.hasFilter() 201 || style.hasFilter()
202 || style.hasBlendMode() 202 || style.hasBlendMode()
203 || style.hasIsolation() 203 || style.hasIsolation()
204 || style.position() == FixedPosition 204 || style.hasViewportConstrainedPosition()
205 || isInTopLayer(element, style) 205 || isInTopLayer(element, style)
206 || hasWillChangeThatCreatesStackingContext(style))) 206 || hasWillChangeThatCreatesStackingContext(style)))
207 style.setZIndex(0); 207 style.setZIndex(0);
208 208
209 if (doesNotInheritTextDecoration(style, element)) 209 if (doesNotInheritTextDecoration(style, element))
210 style.clearAppliedTextDecorations(); 210 style.clearAppliedTextDecorations();
211 211
212 style.applyTextDecorations(); 212 style.applyTextDecorations();
213 213
214 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) 214 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE)
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 style.setDisplay(INLINE_BLOCK); 461 style.setDisplay(INLINE_BLOCK);
462 462
463 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells. 463 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells.
464 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock() 464 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock()
465 // on some sites). 465 // on some sites).
466 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP 466 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP
467 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW ) 467 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW )
468 && style.position() == RelativePosition) 468 && style.position() == RelativePosition)
469 style.setPosition(StaticPosition); 469 style.setPosition(StaticPosition);
470 470
471 // Cannot support position: sticky for table columns and column groups becau se current code is only doing
472 // background painting through columns / column groups
473 if ((style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_COLUM N)
474 && style.position() == StickyPosition)
475 style.setPosition(StaticPosition);
476
471 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns. 477 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns.
472 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though. 478 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though.
473 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP 479 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP
474 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP 480 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP
475 || style.display() == TABLE_CELL) 481 || style.display() == TABLE_CELL)
476 style.setWritingMode(parentStyle.writingMode()); 482 style.setWritingMode(parentStyle.writingMode());
477 483
478 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting 484 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting
479 // of block-flow to anything other than TopToBottomWritingMode. 485 // of block-flow to anything other than TopToBottomWritingMode.
480 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. 486 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support.
481 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) 487 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX))
482 style.setWritingMode(TopToBottomWritingMode); 488 style.setWritingMode(TopToBottomWritingMode);
483 489
484 if (parentStyle.isDisplayFlexibleOrGridBox()) { 490 if (parentStyle.isDisplayFlexibleOrGridBox()) {
485 style.setFloating(NoFloat); 491 style.setFloating(NoFloat);
486 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); 492 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles));
487 493
488 // We want to count vertical percentage paddings/margins on flex items b ecause our current 494 // We want to count vertical percentage paddings/margins on flex items b ecause our current
489 // behavior is different from the spec and we want to gather compatibili ty data. 495 // behavior is different from the spec and we want to gather compatibili ty data.
490 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) 496 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t())
491 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); 497 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical);
492 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) 498 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( ))
493 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); 499 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal);
494 } 500 }
495 } 501 }
496 502
497 } 503 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698