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

Unified Diff: Source/core/rendering/RenderTable.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/web/DOMUtilitiesPrivate.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTable.cpp
diff --git a/Source/core/rendering/RenderTable.cpp b/Source/core/rendering/RenderTable.cpp
index 4df5fed0db9eebeab0289592bcc21b88987981d5..01c1695bf0cea930e02af2974dc07d45576b14f6 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -28,6 +28,7 @@
#include "HTMLNames.h"
#include "core/dom/Document.h"
+#include "core/html/HTMLTableElement.h"
#include "core/page/FrameView.h"
#include "core/rendering/AutoTableLayout.h"
#include "core/rendering/FixedTableLayout.h"
@@ -324,7 +325,7 @@ LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st
// HTML tables' width styles already include borders and paddings, but CSS tables' width styles do not.
LayoutUnit borders = 0;
- bool isCSSTable = !node() || !node()->hasTagName(tableTag);
+ bool isCSSTable = !node() || !isHTMLTableElement(node());
if (isCSSTable && styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive() && style()->boxSizing() == CONTENT_BOX)
borders = borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd());
@@ -341,7 +342,7 @@ LayoutUnit RenderTable::convertStyleLogicalHeightToComputedHeight(const Length&
// HTML tables size as though CSS height includes border/padding, CSS tables do not.
LayoutUnit borders = LayoutUnit();
// FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow.
- if ((node() && node()->hasTagName(tableTag)) || style()->boxSizing() == BORDER_BOX) {
+ if ((node() && isHTMLTableElement(node())) || style()->boxSizing() == BORDER_BOX) {
borders = borderAndPadding;
}
computedLogicalHeight = styleLogicalHeight.value() - borders;
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/web/DOMUtilitiesPrivate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698