Closed Bug 855522 Opened 7 years ago Closed 7 years ago

Paris binding for ClipboardEvent

Categories

(Core :: DOM: Events, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(1 file)

No description provided.
Blocks: 776864
Attached patch patchSplinter Review
https://tbpl.mozilla.org/?tree=Try&rev=8160282ac742

I'm adding default values to the dict properties to get simpler code in the
C++ file. No need to check whether something was passed.
Attachment #730409 - Flags: review?(peterv)
Comment on attachment 730409 [details] [diff] [review]
patch

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

::: content/events/src/nsDOMClipboardEvent.cpp
@@ +70,5 @@
>      if (event) {
>        // Always create a clipboardData for the copy event. If this is changed to
>        // support other types of events, make sure that read/write privileges are
>        // checked properly within nsDOMDataTransfer.
> +      // If you change this, change also Constructor!

... then also change Constructor!

But I have to ask, why can't InitClipboardEvent do all this? It would avoid having two copies of the code. You'd have to pass it the ClipboardEventInit&.

@@ +100,5 @@
> +    if (event) {
> +      // Always create a clipboardData for the copy event. If this is changed to
> +      // support other types of events, make sure that read/write privileges are
> +      // checked properly within nsDOMDataTransfer.
> +      // If you change this, change also InitFromCtor!

Same here.
Attachment #730409 - Flags: review?(peterv) → review+
hmm, I guess it could. ClipboardEvent is a bit unusual
Except that I want to have the current Init*Event for C++
https://hg.mozilla.org/mozilla-central/rev/54bb25670a97
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.