Optimize string usage in setAttribute when dealing with HTML elements

RESOLVED FIXED in Firefox 49

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

36 Branch
mozilla49
Points:
---

Firefox Tracking Flags

(firefox49 fixed)

Details

Attachments

(1 attachment)

Created attachment 8758272 [details] [diff] [review]
less_attr_lowercase.diff

We do a virtual call to InternalGetExistingAttrNameFromQName and nsContentUtils::ASCIIToLower is called twice when adding an attribute.

The patch tries to be consistent with the new aNameToUse handling so that it is set to some
value only if there isn't existing attribute.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=dd4376104618b3320af40503bd366b78063f7811
Attachment #8758272 - Flags: review?(amarchesini)
Comment on attachment 8758272 [details] [diff] [review]
less_attr_lowercase.diff

Review of attachment 8758272 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/Element.h
@@ +659,5 @@
>                           const nsAString& aLocalName,
>                           ErrorResult& aError);
>    bool HasAttribute(const nsAString& aName) const
>    {
> +    return InternalGetAttrNameFromQName(aName) != nullptr;

maybe !!InternalGetAttrNameFromQName(aName);
Attachment #8758272 - Flags: review?(amarchesini) → review+
well, I just renamed the method, not changed its usage.
hmm, tryserver seems to have some unrelated issues atm.

Comment 4

2 years ago
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7b7ea5b410e
Optimize string usage in setAttribute when dealing with HTML elements, r=baku

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b7b7ea5b410e
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.