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

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

Issue 2786743002: Enable position:sticky for <thead> and <tr> elements (Closed)
Patch Set: Rebase over blink reformat Created 3 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. 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (style.Display() == EDisplay::kContents) 333 if (style.Display() == EDisplay::kContents)
334 return; 334 return;
335 335
336 // FIXME: Don't support this mutation for pseudo styles like first-letter or 336 // FIXME: Don't support this mutation for pseudo styles like first-letter or
337 // first-line, since it's not completely clear how that should work. 337 // first-line, since it's not completely clear how that should work.
338 if (style.Display() == EDisplay::kInline && 338 if (style.Display() == EDisplay::kInline &&
339 style.StyleType() == kPseudoIdNone && 339 style.StyleType() == kPseudoIdNone &&
340 style.GetWritingMode() != layout_parent_style.GetWritingMode()) 340 style.GetWritingMode() != layout_parent_style.GetWritingMode())
341 style.SetDisplay(EDisplay::kInlineBlock); 341 style.SetDisplay(EDisplay::kInlineBlock);
342 342
343 // We do not honor position: relative or sticky for table rows, headers, and 343 // We do not honor position: relative for table rows, headers, and footers.
344 // footers. This is correct for position: relative in CSS2.1 (and caused a 344 // This is correct for CSS2.1 (and honoring it caused a crash in
345 // crash in containingBlock() on some sites) and position: sticky is defined 345 // containingBlock() on some sites). It is incorrect for CSS3.
346 // as following position: relative behavior for table elements. It is
347 // incorrect for CSS3.
348 if ((style.Display() == EDisplay::kTableHeaderGroup || 346 if ((style.Display() == EDisplay::kTableHeaderGroup ||
349 style.Display() == EDisplay::kTableRowGroup || 347 style.Display() == EDisplay::kTableRowGroup ||
350 style.Display() == EDisplay::kTableFooterGroup || 348 style.Display() == EDisplay::kTableFooterGroup ||
351 style.Display() == EDisplay::kTableRow) && 349 style.Display() == EDisplay::kTableRow) &&
352 style.HasInFlowPosition()) 350 style.GetPosition() == EPosition::kRelative)
353 style.SetPosition(EPosition::kStatic); 351 style.SetPosition(EPosition::kStatic);
354 352
355 // Cannot support position: sticky for table columns and column groups because 353 // Cannot support position: sticky for table columns and column groups because
356 // current code is only doing background painting through columns / column 354 // current code is only doing background painting through columns / column
357 // groups. 355 // groups.
358 if ((style.Display() == EDisplay::kTableColumnGroup || 356 if ((style.Display() == EDisplay::kTableColumnGroup ||
359 style.Display() == EDisplay::kTableColumn) && 357 style.Display() == EDisplay::kTableColumn) &&
360 style.GetPosition() == EPosition::kSticky) 358 style.GetPosition() == EPosition::kSticky)
361 style.SetPosition(EPosition::kStatic); 359 style.SetPosition(EPosition::kStatic);
362 360
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 style.SetDisplay(EDisplay::kBlock); 506 style.SetDisplay(EDisplay::kBlock);
509 507
510 // Columns don't apply to svg text elements. 508 // Columns don't apply to svg text elements.
511 if (isSVGTextElement(*element)) 509 if (isSVGTextElement(*element))
512 style.ClearMultiCol(); 510 style.ClearMultiCol();
513 } 511 }
514 AdjustStyleForAlignment(style, layout_parent_style); 512 AdjustStyleForAlignment(style, layout_parent_style);
515 } 513 }
516 514
517 } // namespace blink 515 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698