mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 697b971060b2d475a73c1c3755232a4674d61cf5
This commit is contained in:
parent
f60598909a
commit
b97474fbba
236 changed files with 4817 additions and 893 deletions
|
@ -107,11 +107,22 @@ function createElement(tagName, attrs, parent, doBindEvents) {
|
|||
|
||||
// We set the attributes after binding to events to catch any
|
||||
// event-triggering attribute changes. E.g. form submission.
|
||||
setAttributes(element, attrs);
|
||||
//
|
||||
// But be careful with images: unlike other elements they will start the load
|
||||
// as soon as the attr is set, even if not in the document yet, and sometimes
|
||||
// complete it synchronously, so the append doesn't have the effect we want.
|
||||
// So for images, we want to set the attrs after appending, whereas for other
|
||||
// elements we want to do it before appending.
|
||||
var isImg = (tagName == "img");
|
||||
if (!isImg)
|
||||
setAttributes(element, attrs);
|
||||
|
||||
if (parent)
|
||||
parent.appendChild(element);
|
||||
|
||||
if (isImg)
|
||||
setAttributes(element, attrs);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue