[Webkit-unassigned] [Bug 20212] [XBL] Add full support for element="" attachment

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Aug 2 08:31:00 PDT 2008


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





------- Comment #5 from jchaffraix at webkit.org  2008-08-02 08:30 PDT -------
> > This should use early return, or early ASSERT:
> > +void XBLBindingManager::removeBindingSheet(Document* document,
> > PassRefPtr<CSSStyleSheet> sheet)
> > +{
> > +    StyleSheetVector* documentSheets = m_bindingSheets.get(document);
> > +
> > +    if (documentSheets) {
> > +        for (StyleSheetVector::iterator it = documentSheets->begin(); it !=
> > documentSheets->end(); ++it)
> > +            if (*it == sheet) {
> > +                documentSheets->remove(it - documentSheets->begin());
> > +                return;
> > +            }
> > +    }
> > +    // We should have the sheet in our binding sheets.
> > +    ASSERT_NOT_REACHED();
> > 
> > is it OK to call removeBindingSheet after the document has already been removed
> > from the sheets list?  Part of the code seems to assume it is, part doesn't...
> 
> No; we should have the sheet in the document's list or something went wrong
> (but we do not want to crash).
> 

I have not really replied to your comment: we do not want to crash, that's why
there is a check on documentSheets. However we must have removed the binding
sheet so that's why there is an ASSERT_NOT_REACHED. I will modify the comments
to show that.


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



More information about the webkit-unassigned mailing list