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