During a copy, position:fixed gets converted to position:absolute even if only part...
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Feb 2014 21:55:29 +0000 (21:55 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Feb 2014 21:55:29 +0000 (21:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128688

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adds a field, m_needsPositionStyleConversion, to StyledMarkupAccumulator.

Also, renames the ConvertPositionStyleOnCopy setting to ShouldConvertPositionStyleOnCopy

Test: editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy.html

* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::appendElement):
(WebCore::createMarkupInternal):
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit/mac:

Renames the ConvertPositionStyleOnCopy setting to ShouldConvertPositionStyleOnCopy

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences shouldConvertPositionStyleOnCopy]):
(-[WebPreferences setShouldConvertPositionStyleOnCopy:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Renames the ConvertPositionStyleOnCopy setting to ShouldConvertPositionStyleOnCopy

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldConvertPositionStyleOnCopy):
(WKPreferencesGetShouldConvertPositionStyleOnCopy):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

Performs a copy of the contents of a particular div, rather than the entire body. Makes sure that
no position:fixed -> position:absolute conversion occurs.

* editing/pasteboard/copy-paste-converts-sticky-and-fixed-expected.txt:
* editing/pasteboard/copy-paste-converts-sticky-and-fixed.html:
* editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy-expected.txt: Added.
* editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/copy-paste-converts-sticky-and-fixed-expected.txt
LayoutTests/editing/pasteboard/copy-paste-converts-sticky-and-fixed.html
LayoutTests/editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/markup.cpp
Source/WebCore/page/Settings.in
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index ead1ab033ad2e660e21952e7617515f1436b65f8..50efd1cd23e0eaee8519c009c6a364045c47b70b 100644 (file)
@@ -1,3 +1,18 @@
+2014-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        During a copy, position:fixed gets converted to position:absolute even if only part of the document is selected
+        https://bugs.webkit.org/show_bug.cgi?id=128688
+
+        Reviewed by Ryosuke Niwa.
+
+        Performs a copy of the contents of a particular div, rather than the entire body. Makes sure that
+        no position:fixed -> position:absolute conversion occurs.
+
+        * editing/pasteboard/copy-paste-converts-sticky-and-fixed-expected.txt:
+        * editing/pasteboard/copy-paste-converts-sticky-and-fixed.html:
+        * editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy-expected.txt: Added.
+        * editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy.html: Added.
+
 2014-02-13  Chang Shu  <cshu@webkit.org>
 
         Copying (createMarkup) wrapping text results in space between wrapped lines stripped.
index 5a185dbf76b6a8d847bb697ab5339df37364a478..e42ea5493ba5c258e405bdb5b18e481b50487e2a 100644 (file)
@@ -37,7 +37,7 @@ Markup.description('These tests to see if position:sticky and position:fixed get
 document.designMode = 'on';
 
 if (window.internals)
-    window.internals.settings.setConvertPositionStyleOnCopy(true);
+    window.internals.settings.setShouldConvertPositionStyleOnCopy(true);
 
 var s = window.getSelection();
 
@@ -85,7 +85,7 @@ Markup.description('These tests to see if position:sticky and position:fixed get
 document.designMode = 'on';
 
 if (window.internals)
-    window.internals.settings.setConvertPositionStyleOnCopy(true);
+    window.internals.settings.setShouldConvertPositionStyleOnCopy(true);
 
 var s = window.getSelection();
 
index 780f8a94494ba5dad04f90246be10475a4ebc4e8..8a67646dc983e51585e0ec03118a6071ba690b1e 100644 (file)
@@ -14,7 +14,7 @@ Markup.description('These tests to see if position:sticky and position:fixed get
 document.designMode = 'on';
 
 if (window.internals)
-    window.internals.settings.setConvertPositionStyleOnCopy(true);
+    window.internals.settings.setShouldConvertPositionStyleOnCopy(true);
 
 var s = window.getSelection();
 
diff --git a/LayoutTests/editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy-expected.txt b/LayoutTests/editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy-expected.txt
new file mode 100644 (file)
index 0000000..a407dba
--- /dev/null
@@ -0,0 +1,17 @@
+This tests to see if position:sticky and position:fixed don't get converted to position:static and position:absolute upon copy/paste when there is only a partial selection (not the entire body is selected)
+
+Before:
+| "
+abc"
+| <div>
+|   style="position: fixed; left: 0px; top: 0px;"
+|   "def"
+| "ghi
+"
+
+After:
+| "abc"
+| <div>
+|   style="position: fixed; left: 0px; top: 0px;"
+|   "def"
+| "ghi<#selection-caret>"
diff --git a/LayoutTests/editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy.html b/LayoutTests/editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy.html
new file mode 100644 (file)
index 0000000..61e1347
--- /dev/null
@@ -0,0 +1,30 @@
+<html>
+<head>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+<script type="text/javascript" src="../../resources/dump-as-markup.js"></script>
+</head>
+<body>
+<div contenteditable="true" id="test">
+abc<div style="position: fixed; left: 0px; top: 0px;">def</div>ghi
+</div>
+
+<script>
+
+Markup.description('This tests to see if position:sticky and position:fixed don\'t get converted to position:static and position:absolute upon copy/paste when there is only a partial selection (not the entire body is selected)');
+
+if (window.internals)
+    window.internals.settings.setShouldConvertPositionStyleOnCopy(true);
+
+var e = document.getElementById("test");
+var s = window.getSelection();
+
+Markup.dump('test', 'Before');
+s.setPosition(e, 0);
+document.execCommand("SelectAll");
+document.execCommand("Cut");
+document.execCommand("Paste");
+Markup.dump('test', 'After');
+
+</script>
+</body>
+</html>
index c6705a2e4aef17cf8dcfb65b64526918f5f92a1b..060e5b4de095c78991696735084df3b3d72e02bc 100644 (file)
@@ -1,3 +1,28 @@
+2014-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        During a copy, position:fixed gets converted to position:absolute even if only part of the document is selected
+        https://bugs.webkit.org/show_bug.cgi?id=128688
+
+        Reviewed by Ryosuke Niwa.
+
+        Adds a field, m_needsPositionStyleConversion, to StyledMarkupAccumulator.
+
+        Also, renames the ConvertPositionStyleOnCopy setting to ShouldConvertPositionStyleOnCopy
+
+        Test: editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy.html
+
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
+        (WebCore::StyledMarkupAccumulator::appendElement):
+        (WebCore::createMarkupInternal):
+        * page/Settings.in:
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy):
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+
 2014-02-12  Timothy Hatcher  <timothy@apple.com>
 
         Enable inspection of recently used IndexedDB databases.
index 654e7e03b690bcd20552568c4bca3ea01d23e47c..2c4755343588a13129b9bcf8cde35fed9596ac2c 100644 (file)
@@ -117,17 +117,14 @@ class StyledMarkupAccumulator final : public MarkupAccumulator {
 public:
     enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode };
 
-    StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs, EAnnotateForInterchange, const Range*, Node* highestNodeToBeSerialized = 0);
+    StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs, EAnnotateForInterchange, const Range*, bool needsPositionStyleConversion, Node* highestNodeToBeSerialized = 0);
 
     Node* serializeNodes(Node* startNode, Node* pastEnd);
     void wrapWithNode(Node&, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode);
     void wrapWithStyleNode(StyleProperties*, Document&, bool isBlock = false);
     String takeResults();
     
-    bool needRelativeStyleWrapper() const
-    {
-        return m_needRelativeStyleWrapper;
-    }
+    bool needRelativeStyleWrapper() const { return m_needRelativeStyleWrapper; }
 
     using MarkupAccumulator::appendString;
 
@@ -164,13 +161,15 @@ private:
     Node* m_highestNodeToBeSerialized;
     RefPtr<EditingStyle> m_wrappingStyle;
     bool m_needRelativeStyleWrapper;
+    bool m_needsPositionStyleConversion;
 };
 
-inline StyledMarkupAccumulator::StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, EAnnotateForInterchange shouldAnnotate, const Range* range, Node* highestNodeToBeSerialized)
+inline StyledMarkupAccumulator::StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, EAnnotateForInterchange shouldAnnotate, const Range* range, bool needsPositionStyleConversion, Node* highestNodeToBeSerialized)
     : MarkupAccumulator(nodes, shouldResolveURLs, range)
     , m_shouldAnnotate(shouldAnnotate)
     , m_highestNodeToBeSerialized(highestNodeToBeSerialized)
     , m_needRelativeStyleWrapper(false)
+    , m_needsPositionStyleConversion(needsPositionStyleConversion)
 {
 }
 
@@ -328,7 +327,7 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, const Element& e
             if (addDisplayInline)
                 newInlineStyle->forceInline();
             
-            if (element.document().settings() && element.document().settings()->convertPositionStyleOnCopy())
+            if (m_needsPositionStyleConversion)
                 m_needRelativeStyleWrapper |= newInlineStyle->convertFixedAndStickyPosition();
 
             // If the node is not fully selected by the range, then we don't want to keep styles that affect its relationship to the nodes around it
@@ -571,7 +570,9 @@ static String createMarkupInternal(Document& document, const Range& range, const
         fullySelectedRoot = body;
     Node* specialCommonAncestor = highestAncestorToWrapMarkup(&updatedRange, shouldAnnotate);
 
-    StyledMarkupAccumulator accumulator(nodes, shouldResolveURLs, shouldAnnotate, &updatedRange, specialCommonAncestor);
+    bool needsPositionStyleConversion = body && fullySelectedRoot == body
+        && document.settings() && document.settings()->shouldConvertPositionStyleOnCopy();
+    StyledMarkupAccumulator accumulator(nodes, shouldResolveURLs, shouldAnnotate, &updatedRange, needsPositionStyleConversion, specialCommonAncestor);
     Node* pastEnd = updatedRange.pastLastNode();
 
     Node* startNode = updatedRange.firstNode();
@@ -627,7 +628,7 @@ static String createMarkupInternal(Document& document, const Range& range, const
         }
     }
     
-    if (accumulator.needRelativeStyleWrapper() && body && fullySelectedRoot == body) {
+    if (accumulator.needRelativeStyleWrapper() && needsPositionStyleConversion) {
         RefPtr<EditingStyle> positionRelativeStyle = styleFromMatchedRulesAndInlineDecl(body);
         positionRelativeStyle->style()->setProperty(CSSPropertyPosition, CSSValueRelative);
         accumulator.wrapWithStyleNode(positionRelativeStyle->style(), document, true);
index b2452a685811c961deea1ddfa305727c56738026..a0b6433bf935aa248e02784b747473aa876036c0 100644 (file)
@@ -205,4 +205,4 @@ allowMultiElementImplicitSubmission initial=false
 
 mediaPlaybackAllowsAirPlay initial=true, conditional=IOS_AIRPLAY
 
-convertPositionStyleOnCopy initial=false
+shouldConvertPositionStyleOnCopy initial=false
index d8ac0a1fcf9c1bf6e52f635a3a7ef023ff8024cf..9a9b171c74774caf9eab77ead84d09032f4c736d 100644 (file)
@@ -94,7 +94,7 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
     , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
-    , m_convertPositionStyleOnCopy(settings.convertPositionStyleOnCopy())
+    , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy())
 {
 }
 
@@ -156,7 +156,7 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
     settings.setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls);
     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
-    settings.setConvertPositionStyleOnCopy(m_convertPositionStyleOnCopy);
+    settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy);
     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
 }
 
@@ -529,10 +529,10 @@ void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackg
     settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
 }
 
-void InternalSettings::setConvertPositionStyleOnCopy(bool convert, ExceptionCode& ec)
+void InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode& ec)
 {
     InternalSettingsGuardForSettings();
-    settings()->setConvertPositionStyleOnCopy(convert);
+    settings()->setShouldConvertPositionStyleOnCopy(convert);
 }
 
 }
index ac834be0e4f41911439ddbde472e46fcf90d84bd..0b29076abb8c64172d8acae24f335552deeeb930 100644 (file)
@@ -91,7 +91,7 @@ public:
         bool m_useLegacyBackgroundSizeShorthandBehavior;
         bool m_autoscrollForDragAndDropEnabled;
         bool m_pluginReplacementEnabled;
-        bool m_convertPositionStyleOnCopy;
+        bool m_shouldConvertPositionStyleOnCopy;
     };
 
     static PassRefPtr<InternalSettings> create(Page* page)
@@ -137,7 +137,7 @@ public:
     void setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode&);
     void setPluginReplacementEnabled(bool);
     void setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode&);
-    void setConvertPositionStyleOnCopy(bool convert, ExceptionCode&);
+    void setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode&);
 
 
 private:
index 854b9db8a84ed90661b979d66d5de802c9d7776e..a22b5061313806066601f33fc5a96a8e973f1784 100644 (file)
@@ -60,5 +60,5 @@
     [RaisesException] void setFontFallbackPrefersPictographs(boolean preferPictographs);
     void setPluginReplacementEnabled(boolean enabled);
     [RaisesException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
-    [RaisesException] void setConvertPositionStyleOnCopy(boolean convert);
+    [RaisesException] void setShouldConvertPositionStyleOnCopy(boolean convert);
 };
index f92c93da52d318815231708da7c752746be57988..1da2d9b501acedcd2e3c5ad9c82606afaa736d07 100644 (file)
@@ -1,3 +1,20 @@
+2014-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        During a copy, position:fixed gets converted to position:absolute even if only part of the document is selected
+        https://bugs.webkit.org/show_bug.cgi?id=128688
+
+        Reviewed by Ryosuke Niwa.
+
+        Renames the ConvertPositionStyleOnCopy setting to ShouldConvertPositionStyleOnCopy
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences shouldConvertPositionStyleOnCopy]):
+        (-[WebPreferences setShouldConvertPositionStyleOnCopy:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2014-02-13  Alexey Proskuryakov  <ap@apple.com>
 
         [Mac] Add a WebKit1 SPI to get WebCrypto master key from a client
index 452546a93faa6b5c1049c624ac47aa663cd61d06..ce061d4a0c0c427b0002de2cb8bef66599261489 100644 (file)
 #define WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey @"WebKitLowPowerVideoAudioBufferSizeEnabled"
 #define WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey @"WebKitUseLegacyTextAlignPositionedElementBehavior"
 #define WebKitMediaSourceEnabledPreferenceKey @"WebKitMediaSourceEnabled"
-#define WebKitConvertPositionStyleOnCopyPreferenceKey @"WebKitConvertPositionStyleOnCopy"
+#define WebKitShouldConvertPositionStyleOnCopyPreferenceKey @"WebKitShouldConvertPositionStyleOnCopy"
 
 #if !TARGET_OS_IPHONE
 // These are private both because callers should be using the cover methods and because the
index 0d353b85dbb13e991473a9ba5b9da7277588ca0d..7e1f38bc7aba21fb761f10be2791a683720665e2 100644 (file)
@@ -2535,14 +2535,14 @@ static bool needsScreenFontsEnabledQuirk()
     [self _setBoolValue:enabled forKey:WebKitMediaSourceEnabledPreferenceKey];
 }
 
-- (BOOL)convertPositionStyleOnCopy
+- (BOOL)shouldConvertPositionStyleOnCopy
 {
-    return [self _boolValueForKey:WebKitConvertPositionStyleOnCopyPreferenceKey];
+    return [self _boolValueForKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];
 }
 
-- (void)setConvertPositionStyleOnCopy:(BOOL)enabled
+- (void)setShouldConvertPositionStyleOnCopy:(BOOL)enabled
 {
-    [self _setBoolValue:enabled forKey:WebKitConvertPositionStyleOnCopyPreferenceKey];
+    [self _setBoolValue:enabled forKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];
 }
 
 @end
index 2226cf7411f80158b488c3228abff0976000bb6d..d4da612fca93279957a75e0803a8b24eafe94fae 100644 (file)
@@ -432,7 +432,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 - (void)setMediaSourceEnabled:(BOOL)flag;
 - (BOOL)mediaSourceEnabled;
 
-- (void)setConvertPositionStyleOnCopy:(BOOL)flag;
-- (BOOL)convertPositionStyleOnCopy;
+- (void)setShouldConvertPositionStyleOnCopy:(BOOL)flag;
+- (BOOL)shouldConvertPositionStyleOnCopy;
 
 @end
index 189a80e6e07e439fe8500abcfd29220c82bc01a2..4e1ad3c73d5669b1997b9ea977b4ae61f6318b15 100644 (file)
@@ -2382,7 +2382,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setMediaSourceEnabled([preferences mediaSourceEnabled]);
 #endif
 
-    settings.setConvertPositionStyleOnCopy([preferences convertPositionStyleOnCopy]);
+    settings.setShouldConvertPositionStyleOnCopy([preferences shouldConvertPositionStyleOnCopy]);
 
     switch ([preferences storageBlockingPolicy]) {
     case WebAllowAllStorage:
index b0afe391dca906252cba2b85de472e200d6404a7..8746692180e462b8e4b69da4970a10970512ca15 100644 (file)
@@ -1,3 +1,20 @@
+2014-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        During a copy, position:fixed gets converted to position:absolute even if only part of the document is selected
+        https://bugs.webkit.org/show_bug.cgi?id=128688
+
+        Reviewed by Ryosuke Niwa.
+
+        Renames the ConvertPositionStyleOnCopy setting to ShouldConvertPositionStyleOnCopy
+
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetShouldConvertPositionStyleOnCopy):
+        (WKPreferencesGetShouldConvertPositionStyleOnCopy):
+        * UIProcess/API/C/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2014-02-12  Timothy Hatcher  <timothy@apple.com>
 
         Enable inspection of recently used IndexedDB databases.
index 9b84d869c4274f046bc5133d0382afcad0a85232..7837067c19fb1ce7a372dab62b0e5cbcf2d31782 100644 (file)
@@ -190,7 +190,7 @@ namespace WebKit {
     macro(SpatialNavigationEnabled, spatialNavigationEnabled, Bool, bool, false) \
     macro(MediaSourceEnabled, mediaSourceEnabled, Bool, bool, false) \
     macro(ViewGestureDebuggingEnabled, viewGestureDebuggingEnabled, Bool, bool, false) \
-    macro(ConvertPositionStyleOnCopy, convertPositionStyleOnCopy, Bool, bool, false) \
+    macro(ShouldConvertPositionStyleOnCopy, shouldConvertPositionStyleOnCopy, Bool, bool, false) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
index 2093a6c6fe8ce81261ef71b91a51961ffeda90f4..b469ed9cfaa0c0ac3d4a25f602ccdc13b956b65c 100644 (file)
@@ -1236,12 +1236,12 @@ bool WKPreferencesGetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef
     return toImpl(preferencesRef)->viewGestureDebuggingEnabled();
 }
 
-void WKPreferencesSetConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef, bool convert)
+void WKPreferencesSetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef, bool convert)
 {
-    toImpl(preferencesRef)->setConvertPositionStyleOnCopy(convert);
+    toImpl(preferencesRef)->setShouldConvertPositionStyleOnCopy(convert);
 }
 
-bool WKPreferencesGetConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef)
 {
-    return toImpl(preferencesRef)->convertPositionStyleOnCopy();
+    return toImpl(preferencesRef)->shouldConvertPositionStyleOnCopy();
 }
index ba5dabc3516eb14fd523c532cd902f366a614cd4..794621ad9dcca54100c44bc191492eb9b6376047 100644 (file)
@@ -315,8 +315,8 @@ WK_EXPORT void WKPreferencesSetViewGestureDebuggingEnabled(WKPreferencesRef pref
 WK_EXPORT bool WKPreferencesGetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef);
 
 // Default to false.
-WK_EXPORT void WKPreferencesSetConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef, bool convert);
-WK_EXPORT bool WKPreferencesGetConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef, bool convert);
+WK_EXPORT bool WKPreferencesGetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef);
 
 #ifdef __cplusplus
 }
index 77478bacd28cd191224ac4b7ceff6dd8240b94b4..59765998fb060f465618db83ddce5ca5018b1769 100644 (file)
@@ -2575,7 +2575,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings.setMediaSourceEnabled(store.getBoolValueForKey(WebPreferencesKey::mediaSourceEnabledKey()));
 #endif
 
-    settings.setConvertPositionStyleOnCopy(store.getBoolValueForKey(WebPreferencesKey::convertPositionStyleOnCopyKey()));
+    settings.setShouldConvertPositionStyleOnCopy(store.getBoolValueForKey(WebPreferencesKey::shouldConvertPositionStyleOnCopyKey()));
 
     if (store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey())) {
         if (m_processSuppressionDisabledByWebPreference.isActive())