Add support for CallWith=Document to IDL bindings generator |
|||
Issue descriptionIn many places CallWith=ExecutionContext will only ever be passed a Document object. Currently the C++ callsites enforce it at debug runtime by casting with toDocument(). We should be able to enforce this as a constraint at IDL compile time with CallWith=Document. If the interface can be accessed from a non-document execution context the bindings generation should fail.
,
Jan 5 2017
I think they are orthogonal. CallWith=ExecutionContext is redundant with CallWith=ScriptState while CallWith=Document provides compile time safety. You can have CallWith=Document without CallWith=ExecutionContext.
,
Jan 5 2017
I'd prefer having only [CallWith=ScriptState] and providing scriptState->document().
,
Jan 5 2017
I would be okay with that compromise. The trouble I previously had with ExecutionContext* was it was confusing for my reviewer why I could dereference and cast to Document& without any checks. Having scriptState.document() would make it more clear that this is sanctioned behaviour.
,
Mar 15 2017
I'd actually like to discourage CallWith=ScriptState and make almost all callers use Document or ExecutionContext. It's important to being able to write reasonable SimTests and use the web platform internally with C++. ex. Calling Element::animate() should be possible without a ScriptState for a SimTest, or for implementing a web platform feature internally like <marquee>. ex. https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/animation/ElementAnimation.h?type=cs&l=54 This is only taking a ScriptState so it can can the ExecutionContext back, that shouldn't be needed.
,
Mar 15 2017
On the other hand, we want to unify all information about script execution to ScriptState. From that perspective, it's nicer to always use ScriptState rather than using Document sometimes, ExecutionContext sometimes, ScriptState sometimes. Would there be any way to mock ScriptState in SimTests? I think SimTests will anyway need to support some binding things to support more tests.
,
Apr 11 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 12 2018
This issue is left for >1 year, and seems to have no strong objection. So let me close this. Please reopen this, if you have any opinions on this. |
|||
►
Sign in to add a comment |
|||
Comment 1 by jbroman@chromium.org
, Jan 4 2017