Changeset 92118 in webkit
- Timestamp:
- Aug 1, 2011 4:18:15 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r92117 r92118 1 2011-08-01 Mihnea Ovidenie <mihnea@adobe.com> 2 3 BORDER attribute with the object tag, using percentage values not working. 4 https://bugs.webkit.org/show_bug.cgi?id=65176 5 6 Reviewed by Hajime Morita. 7 8 Added the tests with border width with percentages in a new file. Moved them 9 from images border test file. 10 11 * fast/borders/border-width-percent-expected.txt: Added. 12 * fast/borders/border-width-percent.html: Added. 13 * fast/images/border-expected.txt: 14 * fast/images/script-tests/border.js: 15 1 16 2011-08-01 Tony Gentilcore <tonyg@chromium.org> 2 17 -
trunk/LayoutTests/fast/images/border-expected.txt
r91601 r92118 22 22 PASS imageBorderWidth('10q ') is 10 23 23 PASS imageBorderWidth(' 10q ') is 10 24 PASS imageBorderWidth('10%') is 1025 PASS imageBorderWidth('-10%') is 026 PASS imageBorderWidth(' +10%') is 1027 PASS imageBorderWidth(0, 'border-width: 10%') is 028 PASS imageBorderWidth(0, 'border-width: -10%') is 029 24 PASS successfullyParsed is true 30 25 -
trunk/LayoutTests/fast/images/script-tests/border.js
r91601 r92118 37 37 shouldBe("imageBorderWidth(' 10q ')", "10"); 38 38 39 shouldBe("imageBorderWidth('10%')", "10");40 shouldBe("imageBorderWidth('-10%')", "0");41 shouldBe("imageBorderWidth(' +10%')", "10");42 43 shouldBe("imageBorderWidth(0, 'border-width: 10%')", "0");44 shouldBe("imageBorderWidth(0, 'border-width: -10%')", "0");45 46 39 var successfullyParsed = true; -
trunk/Source/WebCore/ChangeLog
r92116 r92118 1 2011-08-01 Mihnea Ovidenie <mihnea@adobe.com> 2 3 BORDER attribute with the object tag, using percentage values not working. 4 https://bugs.webkit.org/show_bug.cgi?id=65176 5 6 Reviewed by Hajime Morita. 7 8 When border presentational attribute for object element has % in it, it should be parsed using HTML parser rules. 9 10 Test: fast/borders/border-width-percent.html 11 12 * html/HTMLElement.cpp: 13 (WebCore::HTMLElement::parseBorderWidthAttribute): 14 * html/HTMLElement.h: 15 * html/HTMLImageElement.cpp: 16 * html/HTMLObjectElement.cpp: 17 (WebCore::HTMLObjectElement::parseMappedAttribute): 18 1 19 2011-08-01 Yuta Kitamura <yutak@chromium.org> 2 20 -
trunk/Source/WebCore/html/HTMLElement.cpp
r89864 r92118 134 134 return CSSValueWebkitPlaintext; 135 135 return CSSValueEmbed; 136 } 137 138 unsigned HTMLElement::parseBorderWidthAttribute(Attribute* attr) 139 { 140 ASSERT(attr && attr->name() == borderAttr); 141 142 unsigned borderWidth = 0; 143 if (!attr->value().isEmpty()) 144 parseHTMLNonNegativeInteger(attr->value(), borderWidth); 145 146 return borderWidth; 136 147 } 137 148 -
trunk/Source/WebCore/html/HTMLElement.h
r87125 r92118 91 91 virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const; 92 92 virtual void parseMappedAttribute(Attribute*); 93 unsigned parseBorderWidthAttribute(Attribute*); 93 94 94 95 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r91601 r92118 97 97 98 98 return HTMLElement::mapToEntry(attrName, result); 99 }100 101 static unsigned int parseBorderWidthAttribute(Attribute* attr)102 {103 ASSERT(attr && attr->name() == borderAttr);104 105 unsigned int borderWidth = 0;106 if (!attr->value().isEmpty() && !attr->value().isNull())107 parseHTMLNonNegativeInteger(attr->value(), borderWidth);108 109 return borderWidth;110 99 } 111 100 -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r91404 r92118 122 122 m_name = newName; 123 123 } else if (attr->name() == borderAttr) { 124 addCSSLength(attr, CSSPropertyBorderWidth, attr->value().toInt() ? attr->value() : "0");124 addCSSLength(attr, CSSPropertyBorderWidth, String::number(parseBorderWidthAttribute(attr))); 125 125 addCSSProperty(attr, CSSPropertyBorderTopStyle, CSSValueSolid); 126 126 addCSSProperty(attr, CSSPropertyBorderRightStyle, CSSValueSolid);
Note: See TracChangeset
for help on using the changeset viewer.