Commit 4b11dc8d authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Revert of Update image data upon changing the img.crossorigin attribute....

Revert of Update image data upon changing the img.crossorigin attribute. (https://codereview.chromium.org/201143002/)

Reason for revert:
The re-issuing of another image load upon setting 'crossorigin' has been reported to cause a site problem (a Google internal site/service.)

Until diagnosed and understood fully, let's back this one out.

Original issue's description:
> Update image data upon changing the img.crossorigin attribute.
> 
> The spec tells us that setting the crossorigin attribute on an img
> element should cause the "update the image data" steps to be invoked,
> 
>  http://www.whatwg.org/specs/web-apps/current-work/#update-the-image-data
> 
> Do so here, along with updating the underlying test's expectation.
> 
> R=
> BUG=341047
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169382

TBR=adamk@chromium.org,abarth@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=341047

Review URL: https://codereview.chromium.org/210403002

git-svn-id: svn://svn.chromium.org/blink/trunk@169874 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ed8ddebd
......@@ -341,6 +341,9 @@ crbug.com/237270 http/tests/images/png-partial-load-no-alpha.html [ Pass Timeout
# FIXME: This is flaky on XP, too, but we omit that until things are rebaselined.
crbug.com/317806 [ Mac ] fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html [ Pass ImageOnlyFailure ]
crbug.com/341435 [ Win ] http/tests/images/image-with-origin-header.html [ Failure Timeout ]
crbug.com/341435 [ Linux Mac ] http/tests/images/image-with-origin-header.html [ Pass Timeout ]
crbug.com/248938 virtual/threaded/animations/3d/transform-origin-vs-functions.html [ Pass Failure ]
crbug.com/248938 [ Linux Win ] virtual/threaded/animations/animation-border-overflow.html [ Pass Timeout ]
crbug.com/248938 virtual/threaded/animations/animation-direction-normal.html [ Pass ImageOnlyFailure Timeout ]
......
......@@ -3,8 +3,8 @@ Tests that the order of setting the src of an image element and its crossOrigin
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Origin: present in request.
PASS Origin: present in request.
PASS srcFirstHasOrigin is false
PASS srcLastHasOrigin is true
PASS successfullyParsed is true
TEST COMPLETE
......
<!DOCTYPE HTML>
<!DOCTYPE html>
<body>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Tests that the order of setting the src of an image element and its crossOrigin attribute doesn't matter");
window.jsTestIsAsync = true;
description("Tests that the order of setting the src of an image element and its crossOrigin attribute doesn't matter");
jsTestIsAsync = true;
// Resource returns a 100x100 image if Origin: is present, a 200x200 one if not.
var testImageURL = "http://127.0.0.1:8000/resources/origin.php";
var successWidth = 100;
function checkIfDone() {
if ("loaded" in img1 && "loaded" in img2)
finishJSTest();
}
function createImage() {
var img = new Image();
img.onload = function () {
(img.width == successWidth ? testPassed : testFailed)("Origin: present in request.");
img.loaded = true;
checkIfDone();
}
return img;
}
img.src="http://127.0.0.1:8000/resources/origin.php?1";
img.crossOrigin = "anonymous";
var img2 = new Image();
img2.crossOrigin = "anonymous";
img2.src="http://127.0.0.1:8000/resources/origin.php?2";
var img1 = createImage();
img1.src = testImageURL + "?1";
img1.crossOrigin = "anonymous";
var srcFirstHasOrigin = false;
var srcLastHasOrigin = false;
document.body.onload = function() {
srcFirstHasOrigin = (img.width == 100)
// srcFirstHasOrigin should be true per spec - see http://crbug.com/341047
shouldBeFalse('srcFirstHasOrigin');
srcLastHasOrigin = (img2.width == 100)
shouldBeTrue('srcLastHasOrigin');
finishJSTest();
};
var img2 = createImage();
img2.crossOrigin = "anonymous";
img2.src = testImageURL + "?2";
</script>
</body>
</html>
<?php
header('HTTP/1.1 302 Found');
header('Location: ' . ($_SERVER['HTTP_ORIGIN'] ? 'square100.png' : 'square200.png'));
?>
$gotOrigin = 0;
foreach (getallheaders() as $name => $value) {
if ($name == "Origin") {
$gotOrigin = 1;
}
}
if ($gotOrigin) {
header('Location: square100.png');
}
else {
header('Location: square200.png');
}
header('HTTP/1.1 302 Redirect');
......@@ -165,9 +165,8 @@ void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr
toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevicePixelRatio);
}
m_imageLoader.updateFromElementIgnoringPreviousError();
} else if (name == crossoriginAttr) {
m_imageLoader.updateFromElementIgnoringPreviousError();
} else if (name == usemapAttr)
}
else if (name == usemapAttr)
setIsLink(!value.isNull());
else if (name == onbeforeloadAttr)
setAttributeEventListener(EventTypeNames::beforeload, createAttributeEventListener(this, name, value));
......
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