diff options
Diffstat (limited to 'third_party/WebKit')
5 files changed, 49 insertions, 2 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/table/border-changes-expected.txt b/third_party/WebKit/LayoutTests/fast/table/border-changes-expected.txt index 6f40c23..fb3307c 100644 --- a/third_party/WebKit/LayoutTests/fast/table/border-changes-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/table/border-changes-expected.txt @@ -123,6 +123,18 @@ PASS getComputedStyle(cell, '').borderLeftColor is red PASS getComputedStyle(cell, '').borderRightColor is red PASS getComputedStyle(cell, '').borderTopColor is red PASS getComputedStyle(cell, '').borderBottomColor is red +PASS getComputedStyle(table, '').borderLeftWidth is '3px' +PASS getComputedStyle(table, '').borderRightWidth is '3px' +PASS getComputedStyle(table, '').borderTopWidth is '3px' +PASS getComputedStyle(table, '').borderBottomWidth is '3px' +PASS getComputedStyle(table, '').borderLeftStyle is 'solid' +PASS getComputedStyle(table, '').borderRightStyle is 'solid' +PASS getComputedStyle(table, '').borderTopStyle is 'solid' +PASS getComputedStyle(table, '').borderBottomStyle is 'solid' +PASS getComputedStyle(table, '').borderLeftColor is yellow +PASS getComputedStyle(table, '').borderRightColor is yellow +PASS getComputedStyle(table, '').borderTopColor is yellow +PASS getComputedStyle(table, '').borderBottomColor is yellow PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/fast/table/border-remove-border-attribute-expected.html b/third_party/WebKit/LayoutTests/fast/table/border-remove-border-attribute-expected.html new file mode 100644 index 0000000..cc6e6f3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/table/border-remove-border-attribute-expected.html @@ -0,0 +1,7 @@ +<table> + <tbody> + <tr> + <td>PASS</td> + </tr> + </tbody> +</table> diff --git a/third_party/WebKit/LayoutTests/fast/table/border-remove-border-attribute.html b/third_party/WebKit/LayoutTests/fast/table/border-remove-border-attribute.html new file mode 100644 index 0000000..bb0da31 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/table/border-remove-border-attribute.html @@ -0,0 +1,10 @@ +<table border="1"> + <tbody> + <tr> + <td>PASS</td> + </tr> + </tbody> +</table> +<script> + document.getElementsByTagName('table')[0].removeAttribute('border'); +</script> diff --git a/third_party/WebKit/LayoutTests/fast/table/script-tests/border-changes.js b/third_party/WebKit/LayoutTests/fast/table/script-tests/border-changes.js index e532931..87ccb15 100644 --- a/third_party/WebKit/LayoutTests/fast/table/script-tests/border-changes.js +++ b/third_party/WebKit/LayoutTests/fast/table/script-tests/border-changes.js @@ -153,4 +153,20 @@ shouldBe("getComputedStyle(cell, '').borderRightColor", "red"); shouldBe("getComputedStyle(cell, '').borderTopColor", "red"); shouldBe("getComputedStyle(cell, '').borderBottomColor", "red"); +// resets to default border width of 3px +table.removeAttribute("border"); + +shouldBe("getComputedStyle(table, '').borderLeftWidth", "'3px'"); +shouldBe("getComputedStyle(table, '').borderRightWidth", "'3px'"); +shouldBe("getComputedStyle(table, '').borderTopWidth", "'3px'"); +shouldBe("getComputedStyle(table, '').borderBottomWidth", "'3px'"); +shouldBe("getComputedStyle(table, '').borderLeftStyle", "'solid'"); +shouldBe("getComputedStyle(table, '').borderRightStyle", "'solid'"); +shouldBe("getComputedStyle(table, '').borderTopStyle", "'solid'"); +shouldBe("getComputedStyle(table, '').borderBottomStyle", "'solid'"); +shouldBe("getComputedStyle(table, '').borderLeftColor", "yellow"); +shouldBe("getComputedStyle(table, '').borderRightColor", "yellow"); +shouldBe("getComputedStyle(table, '').borderTopColor", "yellow"); +shouldBe("getComputedStyle(table, '').borderBottomColor", "yellow"); + document.body.removeChild(table); diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp index 5ab64fc..ca8bde5 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp @@ -127,8 +127,10 @@ static inline CSSValueID unicodeBidiAttributeForDirAuto(HTMLElement* element) unsigned HTMLElement::parseBorderWidthAttribute(const AtomicString& value) const { unsigned borderWidth = 0; - if (value.isEmpty() || !parseHTMLNonNegativeInteger(value, borderWidth)) - return hasTagName(tableTag) ? 1 : borderWidth; + if (value.isEmpty() || !parseHTMLNonNegativeInteger(value, borderWidth)) { + if (hasTagName(tableTag) && !value.isNull()) + return 1; + } return borderWidth; } |