Commit 28764bff authored by darin's avatar darin

LayoutTests:

        Reviewed by Darin and Mitz.

        - Test for http://bugs.webkit.org/show_bug.cgi?id=12305
          REGRESSION: Images do not load in video sections on CNN.com homepage

        * fast/dom/HTMLImageElement/image-lowsrc-getset-expected.txt: Added.
        * fast/dom/HTMLImageElement/image-lowsrc-getset.html: Added.

WebCore:

        Reviewed by Darin and Mitz.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12305
          REGRESSION: Images do not load in video sections on CNN.com homepage

        <rdar://problem/4931480> REGRESSION: Images do not load in video sections on CNN.com homepage (12305)

        Test: fast/dom/HTMLImageElement/image-lowsrc-getset.html

        * html/HTMLAttributeNames.in: Added lowsrc.
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::isURLAttribute): Added lowsrc.
        (WebCore::HTMLImageElement::lowsrc): Added.
        (WebCore::HTMLImageElement::setLowsrc): Added.
        * html/HTMLImageElement.h: Added lowsrc and setLowsrc.
        * html/HTMLImageElement.idl: Added lowsrc.



git-svn-id: svn://svn.chromium.org/blink/trunk@18940 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9130d7c1
2007-01-18 David Kilzer <ddkilzer@kilzer.net>
Reviewed by Darin and Mitz.
- Test for http://bugs.webkit.org/show_bug.cgi?id=12305
REGRESSION: Images do not load in video sections on CNN.com homepage
* fast/dom/HTMLImageElement/image-lowsrc-getset-expected.txt: Added.
* fast/dom/HTMLImageElement/image-lowsrc-getset.html: Added.
2007-01-17 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin
This test checks that the lowsrc attribute of img tags are accessible via JavaScript.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS image.lowsrc is 'http://hostname/lowsrc.png'
PASS image.lowsrc is 'http://hostname/newlowsrc.png'
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
<script src="../../js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<img id="image" lowsrc="http://hostname/lowsrc.png" style="visibility: hidden;">
<script>
description("This test checks that the lowsrc attribute of img tags are accessible via JavaScript.");
var image = document.getElementById('image');
shouldBe("image.lowsrc", "'http://hostname/lowsrc.png'");
image.lowsrc = "http://hostname/newlowsrc.png";
shouldBe("image.lowsrc", "'http://hostname/newlowsrc.png'");
successfullyParsed = true;
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
2007-01-18 David Kilzer <ddkilzer@kilzer.net>
Reviewed by Darin and Mitz.
- fix http://bugs.webkit.org/show_bug.cgi?id=12305
REGRESSION: Images do not load in video sections on CNN.com homepage
<rdar://problem/4931480> REGRESSION: Images do not load in video sections on CNN.com homepage (12305)
Test: fast/dom/HTMLImageElement/image-lowsrc-getset.html
* html/HTMLAttributeNames.in: Added lowsrc.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isURLAttribute): Added lowsrc.
(WebCore::HTMLImageElement::lowsrc): Added.
(WebCore::HTMLImageElement::setLowsrc): Added.
* html/HTMLImageElement.h: Added lowsrc and setLowsrc.
* html/HTMLImageElement.idl: Added lowsrc.
2007-01-18 Simon Hausmann <hausmann@kde.org>
Reviewed by Zack.
......
......@@ -70,6 +70,7 @@ leftmargin
link
longdesc
loop
lowsrc
marginheight
marginwidth
max
......
......@@ -20,6 +20,7 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "HTMLImageElement.h"
......@@ -84,7 +85,7 @@ bool HTMLImageElement::mapToEntry(const QualifiedName& attrName, MappedAttribute
return HTMLElement::mapToEntry(attrName, result);
}
void HTMLImageElement::parseMappedAttribute(MappedAttribute *attr)
void HTMLImageElement::parseMappedAttribute(MappedAttribute* attr)
{
const QualifiedName& attrName = attr->name();
if (attrName == altAttr) {
......@@ -154,7 +155,7 @@ String HTMLImageElement::altText() const
return alt;
}
RenderObject *HTMLImageElement::createRenderer(RenderArena *arena, RenderStyle *style)
RenderObject* HTMLImageElement::createRenderer(RenderArena* arena, RenderStyle* style)
{
if (style->contentData())
return RenderObject::createObject(this, style);
......@@ -209,11 +210,10 @@ int HTMLImageElement::width(bool ignorePendingStylesheets) const
return m_imageLoader.image()->imageSize().width();
}
Document* doc = document();
if (ignorePendingStylesheets)
doc->updateLayoutIgnorePendingStylesheets();
document()->updateLayoutIgnorePendingStylesheets();
else
doc->updateLayout();
document()->updateLayout();
return renderer() ? renderer()->contentWidth() : 0;
}
......@@ -232,18 +232,19 @@ int HTMLImageElement::height(bool ignorePendingStylesheets) const
return m_imageLoader.image()->imageSize().height();
}
Document* doc = document();
if (ignorePendingStylesheets)
doc->updateLayoutIgnorePendingStylesheets();
document()->updateLayoutIgnorePendingStylesheets();
else
doc->updateLayout();
document()->updateLayout();
return renderer() ? renderer()->contentHeight() : 0;
}
bool HTMLImageElement::isURLAttribute(Attribute *attr) const
bool HTMLImageElement::isURLAttribute(Attribute* attr) const
{
return attr->name() == srcAttr || (attr->name() == usemapAttr && attr->value().domString()[0] != '#');
return attr->name() == srcAttr
|| attr->name() == lowsrcAttr
|| (attr->name() == usemapAttr && attr->value().domString()[0] != '#');
}
String HTMLImageElement::name() const
......@@ -281,7 +282,7 @@ String HTMLImageElement::border() const
return getAttribute(borderAttr);
}
void HTMLImageElement::setBorder(const String &value)
void HTMLImageElement::setBorder(const String& value)
{
setAttribute(borderAttr, value);
}
......@@ -322,6 +323,16 @@ void HTMLImageElement::setLongDesc(const String& value)
setAttribute(longdescAttr, value);
}
String HTMLImageElement::lowsrc() const
{
return document()->completeURL(getAttribute(lowsrcAttr));
}
void HTMLImageElement::setLowsrc(const String& value)
{
setAttribute(lowsrcAttr, value);
}
String HTMLImageElement::src() const
{
return document()->completeURL(getAttribute(srcAttr));
......@@ -360,7 +371,7 @@ void HTMLImageElement::setWidth(int value)
int HTMLImageElement::x() const
{
RenderObject *r = renderer();
RenderObject* r = renderer();
if (!r)
return 0;
int x, y;
......@@ -370,7 +381,7 @@ int HTMLImageElement::x() const
int HTMLImageElement::y() const
{
RenderObject *r = renderer();
RenderObject* r = renderer();
if (!r)
return 0;
int x, y;
......
......@@ -91,6 +91,9 @@ public:
String longDesc() const;
void setLongDesc(const String&);
String lowsrc() const;
void setLowsrc(const String&);
String src() const;
void setSrc(const String&);
......
......@@ -35,6 +35,7 @@ module html {
// Extensions
readonly attribute boolean complete;
attribute DOMString lowsrc;
readonly attribute long x;
readonly attribute long y;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment