WebCore: HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jan 2011 06:20:17 +0000 (06:20 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jan 2011 06:20:17 +0000 (06:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=48596

Patch by Julie-Jeongeun-Kim <Jeongeun.Kim@obigo.com> on 2011-01-03
Reviewed by Darin Adler.

border attribute was not parsed in HTMLObjectElement.
I added code for it as HTMLImageElement handled.

new test:fast/html/object-border.html

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseMappedAttribute):

LayoutTests: HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml
https://bugs.webkit.org/show_bug.cgi?id=48596

Patch by Julie-Jeongeun-Kim <Jeongeun.Kim@obigo.com> on 2011-01-03
Reviewed by Darin Adler.

* fast/html/object-border-expected.txt: Added.
* fast/html/object-border.html: Added.
* fast/html/resources/images/blue-border.png: Added.
* fast/html/resources/images/blue.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74957 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/html/object-border-expected.txt [new file with mode: 0644]
LayoutTests/fast/html/object-border.html [new file with mode: 0644]
LayoutTests/fast/html/resources/images/blue-border.png [new file with mode: 0644]
LayoutTests/fast/html/resources/images/blue.png [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLObjectElement.cpp

index db8343f..bbae00f 100644 (file)
@@ -1,3 +1,15 @@
+2011-01-03  Julie-Jeongeun-Kim  <Jeongeun.Kim@obigo.com>
+
+        Reviewed by Darin Adler.
+
+        HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml
+        https://bugs.webkit.org/show_bug.cgi?id=48596
+
+        * fast/html/object-border-expected.txt: Added.
+        * fast/html/object-border.html: Added.
+        * fast/html/resources/images/blue-border.png: Added.
+        * fast/html/resources/images/blue.png: Added.
+
 2010-12-20  Abhishek Arya  <inferno@chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/html/object-border-expected.txt b/LayoutTests/fast/html/object-border-expected.txt
new file mode 100644 (file)
index 0000000..932332a
--- /dev/null
@@ -0,0 +1,17 @@
+Tests for border attribute with Object tag
+Bug 48596 : HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Title   Actual Image    Expected Image
+Object Tag with border="50" px
+       
+PASS border-top-width is 50px.
+PASS border-left-width is 50px.
+PASS border-bottom-width is 50px.
+PASS border-right-width is 50px.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/html/object-border.html b/LayoutTests/fast/html/object-border.html
new file mode 100644 (file)
index 0000000..dc30a93
--- /dev/null
@@ -0,0 +1,55 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+<title>OBJECT - border=pixel</title>
+</head>
+<p id="description"></p>
+<table border="">
+<thead>
+<tr>
+<th> Title </th>
+<th> Actual Image </th>
+<th> Expected Image </th>
+</tr>
+</thead>
+<tr><td><div  valing="center"> Object Tag with border="50" px </div></td>
+    <td><object id="objID" data="./resources/images/blue.png" type="image/png" border="50"></object></td>
+    <td><img src="./resources/images/blue-border.png" /></td>
+</tr>
+</table>
+<div id="console"></div>
+<script type="text/javascript">
+description('Tests for border attribute with Object tag<br/><a href="https://bugs.webkit.org/show_bug.cgi?id=48596">Bug 48596</a> : HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml</p>');
+
+function getStyle(el,styleProp)
+{
+    var x = document.getElementById(el);
+    if (x.currentStyle)
+        var y = x.currentStyle[styleProp];
+    else if (window.getComputedStyle)
+        var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
+
+    return y;
+}
+
+function startTests(prop)
+{
+    var value = getStyle('objID', prop);
+    if (value =="50px")
+        testPassed(prop + " is " + "50px.");
+    else
+        testFailed(prop + " should be " + "50px" + ". Was " + value);  
+}
+
+startTests("border-top-width");
+startTests("border-left-width");
+startTests("border-bottom-width");
+startTests("border-right-width");
+
+var successfullyParsed = true;
+ </script>  
+ <script src="../js/resources/js-test-post.js"></script>
+ </body>
+</html>
+
diff --git a/LayoutTests/fast/html/resources/images/blue-border.png b/LayoutTests/fast/html/resources/images/blue-border.png
new file mode 100644 (file)
index 0000000..8f8e41c
Binary files /dev/null and b/LayoutTests/fast/html/resources/images/blue-border.png differ
diff --git a/LayoutTests/fast/html/resources/images/blue.png b/LayoutTests/fast/html/resources/images/blue.png
new file mode 100644 (file)
index 0000000..4498dd2
Binary files /dev/null and b/LayoutTests/fast/html/resources/images/blue.png differ
index 4ec1d62..48a7a52 100644 (file)
@@ -1,3 +1,18 @@
+2011-01-03  Julie-Jeongeun-Kim  <Jeongeun.Kim@obigo.com>
+
+        Reviewed by Darin Adler.
+
+        HTML5 Conformance Test failure: approved/xhtml5/object_border_pixel.xhtml
+        https://bugs.webkit.org/show_bug.cgi?id=48596
+        
+        border attribute was not parsed in HTMLObjectElement.
+        I added code for it as HTMLImageElement handled.
+
+        new test:fast/html/object-border.html
+
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::parseMappedAttribute):
+
 2011-01-03  Darin Adler  <darin@apple.com>
 
         Try to fix Chromium build.
index c80d374..2c6e6de 100644 (file)
@@ -25,6 +25,7 @@
 #include "HTMLObjectElement.h"
 
 #include "Attribute.h"
+#include "CSSValueKeywords.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
@@ -113,6 +114,12 @@ void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
             document->addNamedItem(newName);
         }
         m_name = newName;
+    } else if (attr->name() == borderAttr) {
+        addCSSLength(attr, CSSPropertyBorderWidth, attr->value().toInt() ? attr->value() : "0");
+        addCSSProperty(attr, CSSPropertyBorderTopStyle, CSSValueSolid);
+        addCSSProperty(attr, CSSPropertyBorderRightStyle, CSSValueSolid);
+        addCSSProperty(attr, CSSPropertyBorderBottomStyle, CSSValueSolid);
+        addCSSProperty(attr, CSSPropertyBorderLeftStyle, CSSValueSolid);
     } else if (isIdAttributeName(attr->name())) {
         const AtomicString& newId = attr->value();
         if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) {