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

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

Issue 2636253002: Handle nested position:sticky elements (Closed)
Patch Set: Rebase Created 3 years, 10 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. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (style.display() == EDisplay::Block && !style.isFloating()) 329 if (style.display() == EDisplay::Block && !style.isFloating())
330 return; 330 return;
331 331
332 // FIXME: Don't support this mutation for pseudo styles like first-letter or 332 // FIXME: Don't support this mutation for pseudo styles like first-letter or
333 // first-line, since it's not completely clear how that should work. 333 // first-line, since it's not completely clear how that should work.
334 if (style.display() == EDisplay::Inline && 334 if (style.display() == EDisplay::Inline &&
335 style.styleType() == PseudoIdNone && 335 style.styleType() == PseudoIdNone &&
336 style.getWritingMode() != parentStyle.getWritingMode()) 336 style.getWritingMode() != parentStyle.getWritingMode())
337 style.setDisplay(EDisplay::InlineBlock); 337 style.setDisplay(EDisplay::InlineBlock);
338 338
339 // After performing the display mutation, check table rows. We do not honor 339 // We do not honor position: relative or sticky for table rows, headers, and
340 // position: relative table rows. This has been established for position: 340 // footers. This is correct for position: relative in CSS2.1 (and caused a
341 // relative in CSS2.1 (and caused a crash in containingBlock() on some sites). 341 // crash in containingBlock() on some sites) and position: sticky is defined
342 // as following position: relative behavior for table elements. It is
343 // incorrect for CSS3.
342 if ((style.display() == EDisplay::TableHeaderGroup || 344 if ((style.display() == EDisplay::TableHeaderGroup ||
343 style.display() == EDisplay::TableRowGroup || 345 style.display() == EDisplay::TableRowGroup ||
344 style.display() == EDisplay::TableFooterGroup || 346 style.display() == EDisplay::TableFooterGroup ||
345 style.display() == EDisplay::TableRow) && 347 style.display() == EDisplay::TableRow) &&
346 style.position() == EPosition::kRelative) 348 style.hasInFlowPosition())
347 style.setPosition(EPosition::kStatic); 349 style.setPosition(EPosition::kStatic);
348 350
349 // Cannot support position: sticky for table columns and column groups because 351 // Cannot support position: sticky for table columns and column groups because
350 // current code is only doing background painting through columns / column 352 // current code is only doing background painting through columns / column
351 // groups. 353 // groups.
352 if ((style.display() == EDisplay::TableColumnGroup || 354 if ((style.display() == EDisplay::TableColumnGroup ||
353 style.display() == EDisplay::TableColumn) && 355 style.display() == EDisplay::TableColumn) &&
354 style.position() == EPosition::kSticky) 356 style.position() == EPosition::kSticky)
355 style.setPosition(EPosition::kStatic); 357 style.setPosition(EPosition::kStatic);
356 358
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 style.setDisplay(EDisplay::Block); 498 style.setDisplay(EDisplay::Block);
497 499
498 // Columns don't apply to svg text elements. 500 // Columns don't apply to svg text elements.
499 if (isSVGTextElement(*element)) 501 if (isSVGTextElement(*element))
500 style.clearMultiCol(); 502 style.clearMultiCol();
501 } 503 }
502 adjustStyleForAlignment(style, parentStyle); 504 adjustStyleForAlignment(style, parentStyle);
503 } 505 }
504 506
505 } // namespace blink 507 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698