WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
149242
HTMLSlotElement should render its assigned nodes
https://bugs.webkit.org/show_bug.cgi?id=149242
Summary
HTMLSlotElement should render its assigned nodes
Ryosuke Niwa
Reported
2015-09-16 18:07:18 PDT
Support rendering the assigned nodes under HTMLSlotElement added in the
bug 149241
.
Attachments
patch
(10.29 KB, patch)
2015-09-21 14:51 PDT
,
Antti Koivisto
rniwa
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-09-17 18:11:36 PDT
<
rdar://problem/22750917
>
Antti Koivisto
Comment 2
2015-09-21 14:51:54 PDT
Created
attachment 261686
[details]
patch
Ryosuke Niwa
Comment 3
2015-09-21 15:06:11 PDT
Comment on
attachment 261686
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261686&action=review
> Source/WebCore/dom/SlotAssignment.cpp:187 > + auto defaultSlotEntry = m_slots.find(emptyAtom);
!? This would result in a hash lookup in each iteration.
> Source/WebCore/style/StyleResolveTree.cpp:473 > +static void attachSlot(HTMLSlotElement& slot, RenderStyle& inheritedStyle, RenderTreePosition& renderTreePosition)
Attach sounds like we're attaching a renderer for a slot. Maybe attachSlotContents would sound better? attachSlotAssignee?
> Source/WebCore/style/StyleResolveTree.cpp:481 > + continue; > + } > + if (is<Element>(*child))
Why don't we just do elseif?
> Source/WebCore/style/StyleResolveTree.cpp:586 > + continue; > + } > + if (is<Element>(*child))
Why don't we just do "else if" instead?
> Source/WebCore/style/StyleResolveTree.cpp:616 > +#if ENABLE(SHADOW_DOM) > + else if (is<HTMLSlotElement>(current)) > + detachSlot(downcast<HTMLSlotElement>(current), detachType); > +#endif > + else if (ShadowRoot* shadowRoot = current.shadowRoot()) > detachShadowRoot(*shadowRoot, detachType);
What happens when a slot element has its own shadow root?
> Source/WebCore/style/StyleResolveTree.cpp:857 > + continue; > + } > + if (is<Element>(*child))
Ditto.
Antti Koivisto
Comment 4
2015-09-21 15:16:24 PDT
(In reply to
comment #3
)
> Comment on
attachment 261686
[details]
> patch > > View in context: > !? This would result in a hash lookup in each iteration.
This fixes a bug, the cached iterator becomes invalid after mutation.
> > Source/WebCore/style/StyleResolveTree.cpp:616 > > +#if ENABLE(SHADOW_DOM) > > + else if (is<HTMLSlotElement>(current)) > > + detachSlot(downcast<HTMLSlotElement>(current), detachType); > > +#endif > > + else if (ShadowRoot* shadowRoot = current.shadowRoot()) > > detachShadowRoot(*shadowRoot, detachType); > > What happens when a slot element has its own shadow root?
We ignore shadow root for slot element when creating the render tree so no need to detach it either. I assume the spec forbids it.
Antti Koivisto
Comment 5
2015-09-21 15:28:16 PDT
https://trac.webkit.org/r190084
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug