2
Vote

GetElementbyId() is case-insensitive

description

HtmlDocument stores the value of all id attributes in a Hashtable (_nodesid). The values of the id attributes are converted to lower case and then used as keys in the HashTable. The Hashtable appears to only be used by the GetElementbyId() method.
 
This behavior is contrary the the HTML spec. For more insight see:
https://developer.mozilla.org/en/Case_Sensitivity_in_class_and_id_Names
 
I believe the fix for this is quite trivial (stop doing ToLower() on the id's), however it will be a breaking change to those that currently rely on this behavior.
 
-William
 
-William

file attachments

comments