Closed Bug 820657 Opened 12 years ago Closed 11 years ago

Implement the NamedGetter functionality on HTMLDocument

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: bzbarsky, Assigned: peterv)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(5 files, 4 obsolete files)

      No description provided.
only store the things we care about in ResolveName so we don't have to
do all the complicated filtering by tag name and whatnot: just do a
hashtable lookup and move on...
Attachment #691181 - Flags: review?(peterv)
Depends on: 820846
Attached file Performance/correctness testcase (obsolete) (deleted) —
There's another testcase at https://bug-104623-attachments.webkit.org/attachment.cgi?id=178683 that can be used to test correctness and can get timing added to measure perf...
Attached file Er, real perf/correctness testcase (deleted) —
Attachment #691919 - Attachment is obsolete: true
Note that we'll need to make the proxy handler for this stuff deal with the [Unforgeable] location.  Right now this patch fails codegen even with bug 821438 fixed.  :(
Summary: Implement the NameGetter functionality on HTMLDocument and turn on WebIDL bindings for it → Implement the NamedGetter functionality on HTMLDocument and turn on WebIDL bindings for it
We'll also need the proxy handler to expose names when called via an Xray but pretend to not be [OverrideBuiltins] in that case...  Might not be too bad because Xrays skip the expando get anyway, so it'll just be a matter of checking up the proto chain like we do for most handlers, but only in the Xray case.
I already have that part working.
Depends on: 824151
Assignee: nobody → peterv
Depends on: 841447
We also need to reimplement .all.
Hmm.  Just because the way it's hooked up right now is messed up?  That seems like a side-project that we need to do anyway; we need a separate bug, yes?
Peter, what's our plan for nsIPluginDocument and nsIImageDocument?  I guess we could just introduce extra interfaces to hold the relevant methods...
Depends on: 852094
Attached patch Support document.all (obsolete) (deleted) — Splinter Review
Updated to trunk. r=me.
Attachment #691181 - Attachment is obsolete: true
Attachment #691181 - Flags: review?(peterv)
Attachment #729529 - Flags: review+
Attachment #729531 - Flags: review?(bzbarsky)
This mostly just moves and reindents code.
Attachment #726127 - Attachment is obsolete: true
Attachment #729533 - Flags: review?(bzbarsky)
Doing this in the NamedGetter for now. We can design a better solution in the future.
Attachment #729535 - Flags: review?(bzbarsky)
Summary: Implement the NamedGetter functionality on HTMLDocument and turn on WebIDL bindings for it → Implement the NamedGetter functionality on HTMLDocument
Comment on attachment 691184 [details] [diff] [review]
part 2.  Turn on WebIDL bindings for HTMLDocument.

Moving this to a separate bug.
Attachment #691184 - Attachment is obsolete: true
Comment on attachment 729531 [details] [diff] [review]
Implement GetSupportedNames on HTMLDocument

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

::: content/html/content/src/nsGenericHTMLElement.h
@@ +717,5 @@
>  
>    static bool TouchEventsEnabled(JSContext* /* unused */, JSObject* /* unused */);
>  
> +  static inline bool
> +  ExposeIdAsHTMLDocumentProperty(Element* aElement)

This sounds as if it would actively go and expose something. Maybe ShouldExpose...?

::: content/html/document/src/nsHTMLDocument.cpp
@@ +2395,4 @@
>  void
>  nsHTMLDocument::GetSupportedNames(nsTArray<nsString>& aNames)
>  {
>    // Nothing, for now.  We should fix that.

We fixed it!
Comment on attachment 729531 [details] [diff] [review]
Implement GetSupportedNames on HTMLDocument

r=me
Attachment #729531 - Flags: review?(bzbarsky) → review+
Comment on attachment 729533 [details] [diff] [review]
Refactor code to support document.all

r=me, I guess
Attachment #729533 - Flags: review?(bzbarsky) → review+
Comment on attachment 729535 [details] [diff] [review]
Hook up document.all in the HTMLDocument NamedGetter

This is icky, but ok for now.

Something here needs to enter the compartment of the wrapper on cx, right?  Either the NamedGetter or nsHTMLDocumentSH::TryResolveAll.

r=me with that.
Attachment #729535 - Flags: review?(bzbarsky) → review+
Blocks: 855971
No longer depends on: 841447
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: