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

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: Make sticky vertical ref tests expectations not dependent on font size. Created 4 years, 8 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections. 192 // object wedged in between them. Auto z-index also becomes 0 for objects th at specify transforms/masks/reflections.
193 if (style.hasAutoZIndex() && ((element && element->document().documentElemen t() == element) 193 if (style.hasAutoZIndex() && ((element && element->document().documentElemen t() == element)
194 || style.hasOpacity() 194 || style.hasOpacity()
195 || style.hasTransformRelatedProperty() 195 || style.hasTransformRelatedProperty()
196 || style.hasMask() 196 || style.hasMask()
197 || style.clipPath() 197 || style.clipPath()
198 || style.boxReflect() 198 || style.boxReflect()
199 || style.hasFilter() 199 || style.hasFilter()
200 || style.hasBlendMode() 200 || style.hasBlendMode()
201 || style.hasIsolation() 201 || style.hasIsolation()
202 || style.position() == FixedPosition 202 || style.hasViewportConstrainedPosition()
203 || isInTopLayer(element, style) 203 || isInTopLayer(element, style)
204 || hasWillChangeThatCreatesStackingContext(style) 204 || hasWillChangeThatCreatesStackingContext(style)
205 || style.containsPaint())) 205 || style.containsPaint()))
206 style.setZIndex(0); 206 style.setZIndex(0);
207 207
208 if (doesNotInheritTextDecoration(style, element)) 208 if (doesNotInheritTextDecoration(style, element))
209 style.clearAppliedTextDecorations(); 209 style.clearAppliedTextDecorations();
210 210
211 style.applyTextDecorations(); 211 style.applyTextDecorations();
212 212
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 style.setDisplay(INLINE_BLOCK); 424 style.setDisplay(INLINE_BLOCK);
425 425
426 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells. 426 // After performing the display mutation, check table rows. We do not honor position: relative table rows or cells.
427 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock() 427 // This has been established for position: relative in CSS2.1 (and caused a crash in containingBlock()
428 // on some sites). 428 // on some sites).
429 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP 429 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G ROUP
430 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW ) 430 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW )
431 && style.position() == RelativePosition) 431 && style.position() == RelativePosition)
432 style.setPosition(StaticPosition); 432 style.setPosition(StaticPosition);
433 433
434 // Cannot support position: sticky for table columns and column groups becau se current code is only doing
435 // background painting through columns / column groups
436 if ((style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_COLUM N)
437 && style.position() == StickyPosition)
438 style.setPosition(StaticPosition);
439
434 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns. 440 // writing-mode does not apply to table row groups, table column groups, tab le rows, and table columns.
435 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though. 441 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though.
436 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP 442 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP || style.display() == TABLE_FOOTER_GROUP
437 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP 443 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW || style.display() == TABLE_ROW_GROUP
438 || style.display() == TABLE_CELL) 444 || style.display() == TABLE_CELL)
439 style.setWritingMode(parentStyle.getWritingMode()); 445 style.setWritingMode(parentStyle.getWritingMode());
440 446
441 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting 447 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting
442 // of block-flow to anything other than TopToBottomWritingMode. 448 // of block-flow to anything other than TopToBottomWritingMode.
443 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. 449 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support.
444 if (style.getWritingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) 450 if (style.getWritingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX))
445 style.setWritingMode(TopToBottomWritingMode); 451 style.setWritingMode(TopToBottomWritingMode);
446 452
447 if (parentStyle.isDisplayFlexibleOrGridBox()) { 453 if (parentStyle.isDisplayFlexibleOrGridBox()) {
448 style.setFloating(NoFloat); 454 style.setFloating(NoFloat);
449 style.setDisplay(equivalentBlockDisplay(style.display())); 455 style.setDisplay(equivalentBlockDisplay(style.display()));
450 456
451 // We want to count vertical percentage paddings/margins on flex items b ecause our current 457 // We want to count vertical percentage paddings/margins on flex items b ecause our current
452 // behavior is different from the spec and we want to gather compatibili ty data. 458 // behavior is different from the spec and we want to gather compatibili ty data.
453 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) 459 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t())
454 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); 460 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical);
455 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) 461 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( ))
456 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); 462 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal);
457 } 463 }
458 } 464 }
459 465
460 } // namespace blink 466 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698