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

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

Issue 2711803002: Disallow 'position: sticky' on <thead> and <tr> elements. (Closed)
Patch Set: Correct layout tests Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/sticky/sticky-table-thead-top-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 if (style.display() == EDisplay::Contents) 332 if (style.display() == EDisplay::Contents)
333 return; 333 return;
334 334
335 // FIXME: Don't support this mutation for pseudo styles like first-letter or 335 // FIXME: Don't support this mutation for pseudo styles like first-letter or
336 // first-line, since it's not completely clear how that should work. 336 // first-line, since it's not completely clear how that should work.
337 if (style.display() == EDisplay::Inline && 337 if (style.display() == EDisplay::Inline &&
338 style.styleType() == PseudoIdNone && 338 style.styleType() == PseudoIdNone &&
339 style.getWritingMode() != layoutParentStyle.getWritingMode()) 339 style.getWritingMode() != layoutParentStyle.getWritingMode())
340 style.setDisplay(EDisplay::InlineBlock); 340 style.setDisplay(EDisplay::InlineBlock);
341 341
342 // After performing the display mutation, check table rows. We do not honor 342 // We do not honor position: relative or sticky for table rows, headers, and
343 // position: relative table rows. This has been established for position: 343 // footers. This is correct for position: relative in CSS2.1 (and caused a
344 // relative in CSS2.1 (and caused a crash in containingBlock() on some sites). 344 // crash in containingBlock() on some sites) and position: sticky is defined
345 // as following position: relative behavior for table elements. It is
346 // incorrect for CSS3.
345 if ((style.display() == EDisplay::TableHeaderGroup || 347 if ((style.display() == EDisplay::TableHeaderGroup ||
346 style.display() == EDisplay::TableRowGroup || 348 style.display() == EDisplay::TableRowGroup ||
347 style.display() == EDisplay::TableFooterGroup || 349 style.display() == EDisplay::TableFooterGroup ||
348 style.display() == EDisplay::TableRow) && 350 style.display() == EDisplay::TableRow) &&
349 style.position() == EPosition::kRelative) 351 style.hasInFlowPosition())
350 style.setPosition(EPosition::kStatic); 352 style.setPosition(EPosition::kStatic);
351 353
352 // Cannot support position: sticky for table columns and column groups because 354 // Cannot support position: sticky for table columns and column groups because
353 // current code is only doing background painting through columns / column 355 // current code is only doing background painting through columns / column
354 // groups. 356 // groups.
355 if ((style.display() == EDisplay::TableColumnGroup || 357 if ((style.display() == EDisplay::TableColumnGroup ||
356 style.display() == EDisplay::TableColumn) && 358 style.display() == EDisplay::TableColumn) &&
357 style.position() == EPosition::kSticky) 359 style.position() == EPosition::kSticky)
358 style.setPosition(EPosition::kStatic); 360 style.setPosition(EPosition::kStatic);
359 361
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 style.setDisplay(EDisplay::Block); 505 style.setDisplay(EDisplay::Block);
504 506
505 // Columns don't apply to svg text elements. 507 // Columns don't apply to svg text elements.
506 if (isSVGTextElement(*element)) 508 if (isSVGTextElement(*element))
507 style.clearMultiCol(); 509 style.clearMultiCol();
508 } 510 }
509 adjustStyleForAlignment(style, parentStyle); 511 adjustStyleForAlignment(style, parentStyle);
510 } 512 }
511 513
512 } // namespace blink 514 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/sticky/sticky-table-thead-top-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698