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

Unified Diff: third_party/WebKit/Source/core/html/HTMLTableColElement.cpp

Issue 2518163002: [css-tables] Fix divide-by-zero resulting from 32-bit overflow (Closed)
Patch Set: update wpt -expected.txt and span-attribute.html but not -expected.txt Created 4 years 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
Index: third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
index 0199445ee167c78468dc07bb4870e39af52865a2..24c079ef2d52b0f8a37e51dcd5e7a07e7a479ffd 100644
--- a/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
@@ -26,9 +26,11 @@
#include "core/CSSPropertyNames.h"
#include "core/HTMLNames.h"
+#include "core/html/HTMLTableCellElement.h"
#include "core/html/HTMLTableElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutTableCol.h"
+#include <algorithm>
namespace blink {
@@ -69,6 +71,7 @@ void HTMLTableColElement::parseAttribute(const QualifiedName& name,
// zero, set it to 1.
newSpan = 1;
}
+ newSpan = std::min(newSpan, HTMLTableCellElement::maxColSpan());
m_span = newSpan;
if (layoutObject() && layoutObject()->isLayoutTableCol())
layoutObject()->updateFromElement();

Powered by Google App Engine
This is Rietveld 408576698