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)
commitb2cfb80f8455ae037f7015e6cbce28de161f8784
treea7e068aefb1d6b6b7c65b4877e2277c938796221
parentbf8ccbc56086c943b90312b2119a441352eda861
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.

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