Closed Bug 598105 Opened 14 years ago Closed 14 years ago

Support the HTML5 data-* attributes in the sanitizing fragment sink

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- final+
blocking1.9.2 --- .11+
status1.9.2 --- .11-fixed
blocking1.9.1 --- .14+
status1.9.1 --- .14-fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

(Keywords: html5)

Attachments

(1 file, 2 obsolete files)

HTML5 allows data-* attributes, and we need to allow them in the sanitizing fragment content sink as well.
Attached patch Patch (v1) (obsolete) — Splinter Review
Attachment #476901 - Flags: review?(bzbarsky)
Attachment #476901 - Flags: approval2.0?
blocking1.9.2: --- → ?
blocking2.0: --- → ?
Comment on attachment 476901 [details] [diff] [review] Patch (v1) >+ if (k.Find(NS_LITERAL_STRING("data-")) != 0) { if (!StringBeginsWith(k, NS_LITERAL_STRING("data-"))) } seems more idiomatic. Also, instead of nested ifs, would it make sense to make use of "&&" here? At this point we have three-deep nesting for what is fundamentally just an and on several boolean expressions.... r=me with those nits.
Attachment #476901 - Flags: review?(bzbarsky)
Attachment #476901 - Flags: review+
Attachment #476901 - Flags: approval2.0?
Attachment #476901 - Flags: approval2.0+
Blocks: 596300
blocking1.9.1: --- → ?
Attached patch Patch (v1.1) (obsolete) — Splinter Review
With comments addressed.
Attachment #476901 - Attachment is obsolete: true
blocking1.9.1: ? → .14+
blocking1.9.2: ? → .11+
> + if ((!sAllowedAttributes && !sAllowedAttributes->GetEntry(keyAtom)) && That first && should be ||.
Attached patch Patch (v1.2)Splinter Review
(In reply to comment #4) > > + if ((!sAllowedAttributes && !sAllowedAttributes->GetEntry(keyAtom)) && > > That first && should be ||. Of course!
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b7
Attachment #476912 - Flags: approval1.9.2.11?
Attachment #476912 - Flags: approval1.9.1.14?
Attachment #476907 - Attachment is obsolete: true
Comment on attachment 476912 [details] [diff] [review] Patch (v1.2) a=LegNeato for 1.9.2.11 and 1.9.1.14
Attachment #476912 - Flags: approval1.9.2.11?
Attachment #476912 - Flags: approval1.9.2.11+
Attachment #476912 - Flags: approval1.9.1.14?
Attachment #476912 - Flags: approval1.9.1.14+
This caused the tree to go red: /builds/slave/mozilla-1.9.2-linux/build/content/html/document/src/nsHTMLFragmentContentSink.cpp:1111: error: no matching function for call to 'StringBeginsWith(nsCAutoString&, const nsString&)' reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Oh, on 1.9.2 and 1.9.1 k is probably a UTF-8 string (and hence you need an NS_LITERAL_CSTRING. I have no idea why this was reopened, though. This is fixed on trunk. I assume you backed it out of 1.9.2, right? So unsetting that flag. Did you back out of 1.9.1 as well?
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Sorry, shouldn't have reopened. I have not backed out the patch as I do not have commit privs. Wasn't sure if we generally file new bugs for bustage or just continue on with the existing one.
Bustage fix pushed on both branches. http://hg.mozilla.org/releases/mozilla-1.9.2/rev/dbd650f54b39 http://hg.mozilla.org/releases/mozilla-1.9.1/rev/c31c35eeb64e I chose to use |key| instead of |k|, which is the UTF-16 version of the latter.
Christian, for bustage we'd generally use the existing bug, since either a bustage fix is pushed (and then we need to say what the changeset for that was) or the patch is backed out (and then whatever bugzilla bit indicates that the patch is checked in needs to be flipped back to the "not checked in" state).
blocking2.0: ? → final+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: