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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 18313005: Introduce isHTMLTableElement and toHTMLTableElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Retry Created 7 years, 5 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 | « Source/core/accessibility/AccessibilityTable.cpp ('k') | Source/core/dom/Position.cpp » ('j') | 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #include "core/dom/DocumentStyleSheetCollection.h" 75 #include "core/dom/DocumentStyleSheetCollection.h"
76 #include "core/dom/FullscreenController.h" 76 #include "core/dom/FullscreenController.h"
77 #include "core/dom/NodeRenderStyle.h" 77 #include "core/dom/NodeRenderStyle.h"
78 #include "core/dom/NodeRenderingContext.h" 78 #include "core/dom/NodeRenderingContext.h"
79 #include "core/dom/Text.h" 79 #include "core/dom/Text.h"
80 #include "core/dom/WebCoreMemoryInstrumentation.h" 80 #include "core/dom/WebCoreMemoryInstrumentation.h"
81 #include "core/dom/shadow/ShadowRoot.h" 81 #include "core/dom/shadow/ShadowRoot.h"
82 #include "core/html/HTMLIFrameElement.h" 82 #include "core/html/HTMLIFrameElement.h"
83 #include "core/html/HTMLInputElement.h" 83 #include "core/html/HTMLInputElement.h"
84 #include "core/html/HTMLOptGroupElement.h" 84 #include "core/html/HTMLOptGroupElement.h"
85 #include "core/html/HTMLTableElement.h"
85 #include "core/html/track/WebVTTElement.h" 86 #include "core/html/track/WebVTTElement.h"
86 #include "core/inspector/InspectorInstrumentation.h" 87 #include "core/inspector/InspectorInstrumentation.h"
87 #include "core/loader/cache/CachedDocument.h" 88 #include "core/loader/cache/CachedDocument.h"
88 #include "core/loader/cache/CachedSVGDocumentReference.h" 89 #include "core/loader/cache/CachedSVGDocumentReference.h"
89 #include "core/page/Frame.h" 90 #include "core/page/Frame.h"
90 #include "core/page/FrameView.h" 91 #include "core/page/FrameView.h"
91 #include "core/page/Page.h" 92 #include "core/page/Page.h"
92 #include "core/page/Settings.h" 93 #include "core/page/Settings.h"
93 #include "core/platform/LinkHash.h" 94 #include "core/platform/LinkHash.h"
94 #include "core/platform/graphics/filters/custom/CustomFilterConstants.h" 95 #include "core/platform/graphics/filters/custom/CustomFilterConstants.h"
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 1457
1457 if (style->display() != NONE) { 1458 if (style->display() != NONE) {
1458 // If we have a <td> that specifies a float property, in quirks mode we just drop the float 1459 // If we have a <td> that specifies a float property, in quirks mode we just drop the float
1459 // property. 1460 // property.
1460 // Sites also commonly use display:inline/block on <td>s and <table>s. I n quirks mode we force 1461 // Sites also commonly use display:inline/block on <td>s and <table>s. I n quirks mode we force
1461 // these tags to retain their display types. 1462 // these tags to retain their display types.
1462 if (document()->inQuirksMode() && e) { 1463 if (document()->inQuirksMode() && e) {
1463 if (e->hasTagName(tdTag)) { 1464 if (e->hasTagName(tdTag)) {
1464 style->setDisplay(TABLE_CELL); 1465 style->setDisplay(TABLE_CELL);
1465 style->setFloating(NoFloat); 1466 style->setFloating(NoFloat);
1466 } else if (e->hasTagName(tableTag)) 1467 } else if (isHTMLTableElement(e))
1467 style->setDisplay(style->isDisplayInlineType() ? INLINE_TABLE : TABLE); 1468 style->setDisplay(style->isDisplayInlineType() ? INLINE_TABLE : TABLE);
1468 } 1469 }
1469 1470
1470 if (e && (e->hasTagName(tdTag) || e->hasTagName(thTag))) { 1471 if (e && (e->hasTagName(tdTag) || e->hasTagName(thTag))) {
1471 if (style->whiteSpace() == KHTML_NOWRAP) { 1472 if (style->whiteSpace() == KHTML_NOWRAP) {
1472 // Figure out if we are really nowrapping or if we should just 1473 // Figure out if we are really nowrapping or if we should just
1473 // use normal instead. If the width of the cell is fixed, then 1474 // use normal instead. If the width of the cell is fixed, then
1474 // we don't actually use NOWRAP. 1475 // we don't actually use NOWRAP.
1475 if (style->width().isFixed()) 1476 if (style->width().isFixed())
1476 style->setWhiteSpace(NORMAL); 1477 style->setWhiteSpace(NORMAL);
1477 else 1478 else
1478 style->setWhiteSpace(NOWRAP); 1479 style->setWhiteSpace(NOWRAP);
1479 } 1480 }
1480 } 1481 }
1481 1482
1482 // Tables never support the -webkit-* values for text-align and will res et back to the default. 1483 // Tables never support the -webkit-* values for text-align and will res et back to the default.
1483 if (e && e->hasTagName(tableTag) && (style->textAlign() == WEBKIT_LEFT | | style->textAlign() == WEBKIT_CENTER || style->textAlign() == WEBKIT_RIGHT)) 1484 if (e && isHTMLTableElement(e) && (style->textAlign() == WEBKIT_LEFT || style->textAlign() == WEBKIT_CENTER || style->textAlign() == WEBKIT_RIGHT))
1484 style->setTextAlign(TASTART); 1485 style->setTextAlign(TASTART);
1485 1486
1486 // Frames and framesets never honor position:relative or position:absolu te. This is necessary to 1487 // Frames and framesets never honor position:relative or position:absolu te. This is necessary to
1487 // fix a crash where a site tries to position these objects. They also n ever honor display. 1488 // fix a crash where a site tries to position these objects. They also n ever honor display.
1488 if (e && (e->hasTagName(frameTag) || e->hasTagName(framesetTag))) { 1489 if (e && (e->hasTagName(frameTag) || e->hasTagName(framesetTag))) {
1489 style->setPosition(StaticPosition); 1490 style->setPosition(StaticPosition);
1490 style->setDisplay(BLOCK); 1491 style->setDisplay(BLOCK);
1491 } 1492 }
1492 1493
1493 // Ruby text does not support float or position. This might change with evolution of the specification. 1494 // Ruby text does not support float or position. This might change with evolution of the specification.
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
3432 void CachedMatchedProperties::reportMemoryUsage(MemoryObjectInfo* memoryObjectIn fo) const 3433 void CachedMatchedProperties::reportMemoryUsage(MemoryObjectInfo* memoryObjectIn fo) const
3433 { 3434 {
3434 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); 3435 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
3435 info.addMember(matchedProperties, "matchedProperties"); 3436 info.addMember(matchedProperties, "matchedProperties");
3436 info.addMember(ranges, "ranges"); 3437 info.addMember(ranges, "ranges");
3437 info.addMember(renderStyle, "renderStyle"); 3438 info.addMember(renderStyle, "renderStyle");
3438 info.addMember(parentRenderStyle, "parentRenderStyle"); 3439 info.addMember(parentRenderStyle, "parentRenderStyle");
3439 } 3440 }
3440 3441
3441 } // namespace WebCore 3442 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/accessibility/AccessibilityTable.cpp ('k') | Source/core/dom/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698