DescriptionsetAttributeNode() does not set the new value to an existing attribute if specified attribute is in a different case.
setAttributeNode() now performs a case-insensitive search for an existing attribute
and if found, retrieves the index of such an attribute. For setting the value we
call upon setAttributeInternal() to which we pass both the index as well as the name.
The name passed to this method is the same as the one passed to the setAttributeNode() API from the webpage and thus can be in any case.
However, setAttributeInternal() uses this name to get the corresponding existing node.
Since this retrieval is not case-insensitive, the existing node is not found and thus
the new value is not set on the existing node.
We should instead use the passed index and use that to retrieve the existing node.
Note that obtaining the attribute's value using getAttributeNode() would still
return the correct value, i.e. the new one.
Also, this now makes our behavior similar to that of FF and IE.
BUG=279193, 282922
R= esprehn@chromium.org,eseidel@chromium.org,ojan@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157015
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157508
Patch Set 1 #Patch Set 2 : making the qualifiedName variable a reference variable and changing the variable name. #
Total comments: 1
Patch Set 3 : modifying the layout testcase #Patch Set 4 : Added layout testcases for XML and HTML documents #
Total comments: 12
Patch Set 5 : modifying the layout testcase #
Total comments: 4
Patch Set 6 : modifying layout testcases #
Total comments: 3
Patch Set 7 : changing layout test case #Patch Set 8 : Fixing regression caused by previous patch-set. #Patch Set 9 : Modified for fixing the crash #
Messages
Total messages: 23 (0 generated)
|