Bug 95451 - Share inline style between cloned Nodes (copy on write.)
Summary: Share inline style between cloned Nodes (copy on write.)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 06:02 PDT by Andreas Kling
Modified: 2012-09-01 10:47 PDT (History)
4 users (show)

See Also:


Attachments
Pätch (3.12 KB, patch)
2012-08-30 06:08 PDT, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2012-08-30 06:02:06 PDT
Cloning a Node shouldn't have to clone the inline style (if there is one) - we could share them until either one mutates.
Comment 1 Andreas Kling 2012-08-30 06:08:11 PDT
Created attachment 161456 [details]
Pätch
Comment 2 Antti Koivisto 2012-08-30 06:51:14 PDT
Comment on attachment 161456 [details]
Pätch

View in context: https://bugs.webkit.org/attachment.cgi?id=161456&action=review

r=me

> Source/WebCore/css/StylePropertySet.cpp:69
> +PassRefPtr<StylePropertySet> StylePropertySet::makeImmutable() const
> +{
> +    if (!isMutable())
> +        return const_cast<StylePropertySet*>(this);
> +    return createImmutable(m_mutablePropertyVector->data(), m_mutablePropertyVector->size(), cssParserMode());
> +}

Name does not really describe this function well. I don't have great ideas though, maybe copyIfNeeded() or similar?
Comment 3 Andreas Kling 2012-09-01 10:47:47 PDT
Committed r127375: <http://trac.webkit.org/changeset/127375>