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

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

Issue 1612273002: Don't force display:table-cell and float:none on table cell elements when in quirks mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/table/quirks-mode-ignore-display-inline-table.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. 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 } 334 }
335 335
336 void StyleAdjuster::adjustStyleForHTMLElement(ComputedStyle& style, const Comput edStyle& parentStyle, HTMLElement& element) 336 void StyleAdjuster::adjustStyleForHTMLElement(ComputedStyle& style, const Comput edStyle& parentStyle, HTMLElement& element)
337 { 337 {
338 // <div> and <span> are the most common elements on the web, we skip all the work for them. 338 // <div> and <span> are the most common elements on the web, we skip all the work for them.
339 if (isHTMLDivElement(element) || isHTMLSpanElement(element)) 339 if (isHTMLDivElement(element) || isHTMLSpanElement(element))
340 return; 340 return;
341 341
342 if (isHTMLTableCellElement(element)) { 342 if (isHTMLTableCellElement(element)) {
343 // If we have a <td> that specifies a float property, in quirks mode we just drop the float property.
344 // FIXME: Why is this only <td> and not <th>?
345 if (element.hasTagName(tdTag) && m_useQuirksModeStyles) {
346 style.setDisplay(TABLE_CELL);
347 style.setFloating(NoFloat);
348 }
349 // FIXME: We shouldn't be overriding start/-webkit-auto like this. Do it in html.css instead. 343 // FIXME: We shouldn't be overriding start/-webkit-auto like this. Do it in html.css instead.
350 // Table headers with a text-align of -webkit-auto will change the text- align to center. 344 // Table headers with a text-align of -webkit-auto will change the text- align to center.
351 if (element.hasTagName(thTag) && style.textAlign() == TASTART) 345 if (element.hasTagName(thTag) && style.textAlign() == TASTART)
352 style.setTextAlign(CENTER); 346 style.setTextAlign(CENTER);
353 if (style.whiteSpace() == KHTML_NOWRAP) { 347 if (style.whiteSpace() == KHTML_NOWRAP) {
354 // Figure out if we are really nowrapping or if we should just 348 // Figure out if we are really nowrapping or if we should just
355 // use normal instead. If the width of the cell is fixed, then 349 // use normal instead. If the width of the cell is fixed, then
356 // we don't actually use NOWRAP. 350 // we don't actually use NOWRAP.
357 if (style.width().isFixed()) 351 if (style.width().isFixed())
358 style.setWhiteSpace(NORMAL); 352 style.setWhiteSpace(NORMAL);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 // We want to count vertical percentage paddings/margins on flex items b ecause our current 473 // We want to count vertical percentage paddings/margins on flex items b ecause our current
480 // behavior is different from the spec and we want to gather compatibili ty data. 474 // behavior is different from the spec and we want to gather compatibili ty data.
481 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) 475 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t())
482 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); 476 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical);
483 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) 477 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( ))
484 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); 478 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal);
485 } 479 }
486 } 480 }
487 481
488 } 482 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/quirks-mode-ignore-display-inline-table.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698