[Webkit-unassigned] [Bug 89000] [CSS Regions] Fix the lifecycle for the flow objects and their renderers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 11 16:15:18 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89000





--- Comment #35 from Andrei Bucur <abucur at adobe.com>  2012-07-11 16:15:17 PST ---
(In reply to comment #33)
> (From update of attachment 151436 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=151436&action=review
> 
> > Source/WebCore/dom/WebKitNamedFlowCollection.cpp:65
> > +    NamedFlowSet::const_iterator end = m_namedFlows.end();
> > +    for (NamedFlowSet::const_iterator it = m_namedFlows.begin(); it != end; ++it) {
> > +        WebKitNamedFlow* namedFlow = *it;
> > +        if (namedFlow->getFlowState() == WebKitNamedFlow::FlowStateCreated) {
> > +            if (!index)
> > +                return namedFlow;
> > +            --index;
> > +        }
> > +    }
> 
> So this implementation has an odd quirk that if a flow is instantiated (NULL) and then later moved to (CREATED) it will push all the observable flows after it "down by one" in the index.  Basically, iterating this collection is no-where-near stable.  I guess that's generally true of live collections like this.  Seems like an odd spec/implementation choice.
When a flow is "created" it's in the CREATED state :). There's no point in creating one if it's not declared in CSS. I agree that iterating through this collection can bring up some unexpected results.
I haven't focused much on these as they are not exposed yet through the live collection. When their time comes and I'll write some layout tests for them I'll polish them as best I can.
> 
> Also seems like a behavior we could test.
> 
> > Source/WebCore/dom/WebKitNamedFlowCollection.cpp:77
> > +WebKitNamedFlow* WebKitNamedFlowCollection::flowByName(const String& flowName)
> > +{
> > +    NamedFlowSet::iterator it = m_namedFlows.find<String, NamedFlowHashTranslator>(flowName);
> > +    if (it == m_namedFlows.end() || (*it)->getFlowState() == WebKitNamedFlow::FlowStateNull)
> > +        return 0;
> > +
> > +    return *it;
> > +}
> 
> I assume it's spec'd that these flows are ordered and flows with duplicate names return the first?
It's not possible to have duplicate flows (it would indicate a serious bug in the implementation). This why this is a set and not a list.
> 
> > Source/WebCore/rendering/RenderNamedFlowThread.cpp:193
> > +    if (canBeDestroyed()) {
> > +        destroy();
> > +        return;
> > +    }
> 
> Is this some sort of ref-counting solution?
This makes sure renderers for NamedFlows that have no content and no regions are removed the render tree. This as well moves the NamedFlow object attached to it in the NULL state.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list