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

Unified Diff: Source/core/rendering/RenderTable.cpp

Issue 197283025: Use new is*Element() helper functions more in rendering code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderProgress.cpp ('k') | Source/core/rendering/RenderTableCell.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 96744e3c41d120b5891f2df072dd4fa535c08e6d..25476f5605a241056a75f9da84c7a534a893aba1 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -29,6 +29,7 @@
#include "HTMLNames.h"
#include "core/dom/Document.h"
#include "core/frame/FrameView.h"
+#include "core/html/HTMLTableElement.h"
#include "core/rendering/AutoTableLayout.h"
#include "core/rendering/FastTextAutosizer.h"
#include "core/rendering/FixedTableLayout.h"
@@ -332,7 +333,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 = !isHTMLTableElement(node());
if (isCSSTable && styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive() && style()->boxSizing() == CONTENT_BOX)
borders = borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd());
@@ -349,7 +350,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 (isHTMLTableElement(node()) || style()->boxSizing() == BORDER_BOX) {
borders = borderAndPadding;
}
computedLogicalHeight = styleLogicalHeight.value() - borders;
« no previous file with comments | « Source/core/rendering/RenderProgress.cpp ('k') | Source/core/rendering/RenderTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698