[Webkit-unassigned] [Bug 85598] Share stylesheet data structures between documents

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 6 05:54:53 PDT 2012


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





--- Comment #12 from Antti Koivisto <koivisto at iki.fi>  2012-05-06 05:54:52 PST ---
(In reply to comment #10)
> (From update of attachment 140396 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=140396&action=review
> 
> It seems really easy to forget to do one of these “will mutate” or “did mutate” calls. Is there some way to make it easy to catch that kind of mistake when people change this code in the future?

If you don't invoke didMutateRules then the mutation will not be reflected in rendering. Basic testing should pick this up. In didMutateRules we ASSERT(m_internal->isMutable()) and mutable bit is only set by willMutateRules. This should help some.

Generally we should avoid adding new mutating CSSOM APIs (by not having them into standards in the first place).


> > Source/WebCore/css/CSSRule.h:27
> > +#include "ExceptionCode.h"
> 
> Why change to this instead of the forward-declaration typedef? It seems the code was already doing things the conventional way.

I had impression ExceptionCode.h was trivial (but it seems to be including some other header with a FIXME) and I didn't like having the type defined in multiple places (typedef is not exactly forward-declaration).

If the idea is to always redefine ExceptionCode in the header, why is it defined in ExceptionCode.h at all?

> > Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp:379
> > +    m_propertySet->deref();
> > +    m_propertySet = propertySet;
> > +    m_propertySet->ref();
> 
> Why isn’t m_propertySet a RefPtr?

PropertySetCSSStyleDeclaration has two subclasses, one of which uses forwarding refcounting scheme. This can be fixed when InlineCSSStyleDeclaration is switched to conventional refcounting.

-- 
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