Bug 128982 - Convert position:sticky to position:static upon copy and paste
Summary: Convert position:sticky to position:static upon copy and paste
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-02-18 11:09 PST by Myles C. Maxfield
Modified: 2014-02-24 18:42 PST (History)
2 users (show)

See Also:


Attachments
Patch (18.00 KB, patch)
2014-02-18 11:11 PST, Myles C. Maxfield
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2014-02-18 11:09:57 PST
Convert position:sticky to position:static upon copy and paste
Comment 1 Myles C. Maxfield 2014-02-18 11:11:58 PST
Created attachment 224524 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-02-18 11:23:41 PST
Comment on attachment 224524 [details]
Patch

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

> Source/WebCore/editing/EditingStyle.cpp:1231
>      RefPtr<CSSPrimitiveValue> fixed = cssValuePool().createIdentifierValue(CSSValueFixed);
> +    RefPtr<CSSPrimitiveValue> absolute = cssValuePool().createIdentifierValue(CSSValueAbsolute);

You should declare these before first use, to avoid making them in the early return cases.
Comment 3 Myles C. Maxfield 2014-02-18 11:25:39 PST
Comment on attachment 224524 [details]
Patch

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

>> Source/WebCore/editing/EditingStyle.cpp:1231
>> +    RefPtr<CSSPrimitiveValue> absolute = cssValuePool().createIdentifierValue(CSSValueAbsolute);
> 
> You should declare these before first use, to avoid making them in the early return cases.

Done.
Comment 4 Dean Jackson 2014-02-18 11:28:12 PST
Comment on attachment 224524 [details]
Patch

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

> Source/WebCore/ChangeLog:12
> +        2. Now that we copy position:sticky, convert that to position:fixed

You say this here....

> Source/WebCore/editing/EditingStyle.cpp:1233
> +    if (m_mutableStyle->propertyMatches(CSSPropertyPosition, sticky.get())) {
> +        m_mutableStyle->setProperty(CSSPropertyPosition, cssValuePool().createIdentifierValue(CSSValueStatic), m_mutableStyle->propertyIsImportant(CSSPropertyPosition));

... but then change it to position:static.

> Source/WebCore/editing/EditingStyle.cpp:1241
> +    if (m_mutableStyle->propertyMatches(CSSPropertyPosition, absolute.get()))
> +        return true;

Should the name of the method change now?
Comment 6 Radar WebKit Bug Importer 2014-02-24 18:42:01 PST
<rdar://problem/16156147>