[Webkit-unassigned] [Bug 20247] setAttributeNode() does not work when attribute name has a capital letter in it
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Aug 22 20:15:53 PDT 2008
https://bugs.webkit.org/show_bug.cgi?id=20247
------- Comment #8 from jchaffraix at webkit.org 2008-08-22 20:15 PDT -------
>
> 177 if (name == (shouldIgnoreAttributeCase ?
> m_attributes[i]->name().toString().lower() :
> m_attributes[i]->name().toString()))
>
> Calling lower() is a slower way to do a case insensitive comparison that often
> allocates memory. A faster way is to call equalIgnoringCase.
Ok, I will change that.
>
> 71 Attribute* getAttributeItem(const String& name, bool
> shouldIgnoreAttributeCase = false) const;
>
> Can we do without the default value? How many callers are there that rely on
> the default?
There is ~5/6 callers that do so.
> What's the performance impact of this change? The function seems simple enough
> that I could imagine having multiple copies of it if there are callers who have
> no reason to pass the boolean, but on the other hand it's possibly slow enough
> already that this extra work has little impact.
I have not evaluated the performance issues. As there is a few callers and it
is showing the peculiarities in how strings are handled to match an attribute
(case sensitive or not, using lower case name or not, ...), I think it is
better to simply remove the default value as you suggested.
> 82 function testAttribNodeNamePreservesCaseGetNode2() {
>
> I'd prefer that even JavaScript follow our coding guidelines and put braces on
> a separate line for function definitions.
>
> 92 if (!a) {
> 93 return "FAIL";
> 94 }
>
> And omit braces for one line if statements.
>
I will make it abide by our coding style rules.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list