Pass Document instead of ScriptExecutionContext to non-worker constructors
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2015 18:18:40 +0000 (18:18 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2015 18:18:40 +0000 (18:18 +0000)
commit50b1e0efb62a00c455081e600cacc6591db81269
treeaae71fd2f4483929a6949dfa13f8b1fff4e62e37
parent903dcc6750e71c4f457d0f66c32ef286023cabce
Pass Document instead of ScriptExecutionContext to non-worker constructors
https://bugs.webkit.org/show_bug.cgi?id=140040

Reviewed by Sam Weinig.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition):
Generate code passing the document when ConstructorCallWith=Document is used.
Later, we could base this on whether the constructor is exposed to workers
or not, instead, but for now this seems a clean way to do it.

* bindings/scripts/IDLAttributes.txt: Allow ConstructorCallWith=Document.

* Modules/notifications/Notification.cpp:
(WebCore::Notification::create):
* Modules/notifications/Notification.h:
* Modules/notifications/Notification.idl:
* dom/Comment.cpp:
* dom/Comment.h:
* dom/Comment.idl:
* dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::nodeName): Use ASCIILiteral (just something
I noticed in passing).
* dom/DocumentFragment.h:
* dom/DocumentFragment.idl:
* dom/Range.cpp:
* dom/Range.h:
* dom/Range.idl:
* dom/Text.cpp:
* dom/Text.h:
* dom/Text.idl:
Change from ScriptExecutionContext to Document, and remove unneeded
overloads that were just casting. It's better to have the bindings
layer, which knows these are not ScriptExecutionContext, do the cast
than to have create functions that cast that are not in any position
to know the cast is safe.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/notifications/Notification.idl
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/dom/Comment.cpp
Source/WebCore/dom/Comment.h
Source/WebCore/dom/Comment.idl
Source/WebCore/dom/DocumentFragment.cpp
Source/WebCore/dom/DocumentFragment.h
Source/WebCore/dom/DocumentFragment.idl
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/Range.h
Source/WebCore/dom/Range.idl
Source/WebCore/dom/Text.cpp
Source/WebCore/dom/Text.h
Source/WebCore/dom/Text.idl