Changeset 96224 in webkit
- Timestamp:
- Sep 28, 2011 8:52:19 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96223 r96224 1 2011-09-28 Antaryami Pandia <antaryami.pandia@motorola.com> 2 3 Reflected attribute input.size wraps on negative values (Chrome), or 4 returns them (Safari). 5 https://bugs.webkit.org/show_bug.cgi?id=44886 6 7 Reviewed by Darin Adler. 8 9 * fast/dom/HTMLInputElement/input-size-attribute-expected.txt: Added. 10 * fast/dom/HTMLInputElement/input-size-attribute.html: Added. 11 * fast/dom/HTMLInputElement/script-tests/size-attribute.js: 12 * fast/dom/HTMLInputElement/size-attribute-expected.txt: 13 1 14 2011-09-28 Vsevolod Vlasov <vsevik@chromium.org> 2 15 -
trunk/LayoutTests/fast/dom/HTMLInputElement/script-tests/size-attribute.js
r48551 r96224 8 8 } 9 9 10 shouldBe('document.createElement("input").size', '20'); // Gecko and WebKit don't match.10 shouldBe('document.createElement("input").size', '20'); 11 11 12 shouldBe('sizeAttributeEffect("")', ' 0');12 shouldBe('sizeAttributeEffect("")', '20'); 13 13 14 14 shouldBe('sizeAttributeEffect("1")', '1'); … … 16 16 shouldBe('sizeAttributeEffect("10")', '10'); 17 17 18 shouldBe('sizeAttributeEffect("0")', ' 0');18 shouldBe('sizeAttributeEffect("0")', '20'); 19 19 20 shouldBe('sizeAttributeEffect("-1")', ' -1'); // Gecko and WebKit don't match.20 shouldBe('sizeAttributeEffect("-1")', '20'); 21 21 22 22 shouldBe('sizeAttributeEffect("1x")', '1'); … … 27 27 shouldBe('sizeAttributeEffect("2.9")', '2'); 28 28 29 shouldBe('sizeAttributeEffect("a")', ' 0');29 shouldBe('sizeAttributeEffect("a")', '20'); 30 30 31 31 var arabicIndicDigitOne = String.fromCharCode(0x661); 32 shouldBe('sizeAttributeEffect(arabicIndicDigitOne)', ' 0');32 shouldBe('sizeAttributeEffect(arabicIndicDigitOne)', '20'); 33 33 shouldBe('sizeAttributeEffect("2" + arabicIndicDigitOne)', '2'); 34 34 -
trunk/LayoutTests/fast/dom/HTMLInputElement/size-attribute-expected.txt
r37531 r96224 5 5 6 6 PASS document.createElement("input").size is 20 7 PASS sizeAttributeEffect("") is 07 PASS sizeAttributeEffect("") is 20 8 8 PASS sizeAttributeEffect("1") is 1 9 9 PASS sizeAttributeEffect("2") is 2 10 10 PASS sizeAttributeEffect("10") is 10 11 PASS sizeAttributeEffect("0") is 012 PASS sizeAttributeEffect("-1") is -111 PASS sizeAttributeEffect("0") is 20 12 PASS sizeAttributeEffect("-1") is 20 13 13 PASS sizeAttributeEffect("1x") is 1 14 14 PASS sizeAttributeEffect("1.") is 1 … … 17 17 PASS sizeAttributeEffect("2.") is 2 18 18 PASS sizeAttributeEffect("2.9") is 2 19 PASS sizeAttributeEffect("a") is 020 PASS sizeAttributeEffect(arabicIndicDigitOne) is 019 PASS sizeAttributeEffect("a") is 20 20 PASS sizeAttributeEffect(arabicIndicDigitOne) is 20 21 21 PASS sizeAttributeEffect("2" + arabicIndicDigitOne) is 2 22 22 PASS successfullyParsed is true -
trunk/Source/WebCore/ChangeLog
r96223 r96224 1 2011-09-28 Antaryami Pandia <antaryami.pandia@motorola.com> 2 3 Reflected attribute input.size wraps on negative values (Chrome), or 4 returns them (Safari). 5 https://bugs.webkit.org/show_bug.cgi?id=44886 6 7 Reviewed by Darin Adler. 8 9 Test: fast/dom/HTMLInputElement/input-size-attribute.html 10 11 * html/HTMLInputElement.cpp: 12 (WebCore::HTMLInputElement::parseMappedAttribute): 13 1 14 2011-09-28 Vsevolod Vlasov <vsevik@chromium.org> 2 15 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r95911 r96224 769 769 parseMaxLengthAttribute(attr); 770 770 else if (attr->name() == sizeAttr) { 771 m_size = attr->isNull() ? defaultSize : attr->value().toInt(); 772 if (renderer()) 771 int oldSize = m_size; 772 int value = attr->value().toInt(); 773 m_size = value > 0 ? value : defaultSize; 774 if (m_size != oldSize && renderer()) 773 775 renderer()->setNeedsLayoutAndPrefWidthsRecalc(); 774 776 } else if (attr->name() == altAttr)
Note: See TracChangeset
for help on using the changeset viewer.