https://bugs.webkit.org/show_bug.cgi?id=76459
Reviewed by Darin Fisher.
.:
* Source/autotools/symbols.filter:
Source/WebCore:
This should be a setting because it is independent of a particular frame and
should be preserved even if the mainframe changes.
Renamed (set)ShouldLayoutFixedElementsRelativeToFrame to
(set)FixedElementsLayoutRelativeToFrame due to the connotation
the word "should" may have in this context: If set,
position:fixed elements will ALWAYS be laid out relative to the frame.
* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::scrollXForFixedPosition):
(WebCore::FrameView::scrollYForFixedPosition):
(WebCore::FrameView::fixedElementsLayoutRelativeToFrame):
(WebCore):
* page/FrameView.h:
(FrameView):
* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setFixedElementsLayoutRelativeToFrame):
(WebCore):
* page/Settings.h:
(Settings):
(WebCore::Settings::fixedElementsLayoutRelativeToFrame):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::fixedElementLaysOutRelativeToFrame):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
* rendering/RenderBox.h:
(RenderBox):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setFixedElementsLayoutRelativeToFrame):
* testing/InternalSettings.h:
(InternalSettings):
* testing/InternalSettings.idl:
Source/WebKit/chromium:
* public/WebSettings.h:
():
* public/WebView.h:
(WebView):
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setFixedElementsLayoutRelativeToFrame):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):
* src/WebViewImpl.cpp:
* src/WebViewImpl.h:
(WebViewImpl):
Source/WebKit2:
* win/WebKit2.def:
* win/WebKit2CFLite.def:
LayoutTests:
* fast/repaint/fixed-in-page-scale.html:
* fast/repaint/fixed-right-bottom-in-page-scale.html:
* fast/repaint/fixed-right-in-page-scale.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106146
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-27 Fady Samuel <fsamuel@chromium.org>
+
+ Rename shouldLayoutFixedElementsRelativeToFrame and make it a setting
+ https://bugs.webkit.org/show_bug.cgi?id=76459
+
+ Reviewed by Darin Fisher.
+
+ * Source/autotools/symbols.filter:
+
2012-01-26 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add basic printing support to WebKit2
+2012-01-27 Fady Samuel <fsamuel@chromium.org>
+
+ Rename shouldLayoutFixedElementsRelativeToFrame and make it a setting
+ https://bugs.webkit.org/show_bug.cgi?id=76459
+
+ Reviewed by Darin Fisher.
+
+ * fast/repaint/fixed-in-page-scale.html:
+ * fast/repaint/fixed-right-bottom-in-page-scale.html:
+ * fast/repaint/fixed-right-in-page-scale.html:
+
2012-01-27 Greg Billock <gbillock@google.com>
Update chromium-specific expectation for navigator-detached-no-crash layout test to include startActivity
<script>
window.enablePixelTesting = true;
if (window.internals)
- window.internals.settings.setShouldLayoutFixedElementsRelativeToFrame(true);
+ window.internals.settings.setFixedElementsLayoutRelativeToFrame(true);
function scroll() {
window.scrollTo(100,100);
<script>
window.enablePixelTesting = true;
if (window.internals)
- window.internals.settings.setShouldLayoutFixedElementsRelativeToFrame(true);
+ window.internals.settings.setFixedElementsLayoutRelativeToFrame(true);
function scroll() {
window.scrollTo(100,100);
<script>
window.enablePixelTesting = true;
if (window.internals)
- window.internals.settings.setShouldLayoutFixedElementsRelativeToFrame(true);
+ window.internals.settings.setFixedElementsLayoutRelativeToFrame(true);
function scroll() {
window.scrollTo(100,100);
+2012-01-27 Fady Samuel <fsamuel@chromium.org>
+
+ Rename shouldLayoutFixedElementsRelativeToFrame and make it a setting
+ https://bugs.webkit.org/show_bug.cgi?id=76459
+
+ Reviewed by Darin Fisher.
+
+ This should be a setting because it is independent of a particular frame and
+ should be preserved even if the mainframe changes.
+
+ Renamed (set)ShouldLayoutFixedElementsRelativeToFrame to
+ (set)FixedElementsLayoutRelativeToFrame due to the connotation
+ the word "should" may have in this context: If set,
+ position:fixed elements will ALWAYS be laid out relative to the frame.
+
+
+ * WebCore.exp.in:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::reset):
+ (WebCore::FrameView::scrollXForFixedPosition):
+ (WebCore::FrameView::scrollYForFixedPosition):
+ (WebCore::FrameView::fixedElementsLayoutRelativeToFrame):
+ (WebCore):
+ * page/FrameView.h:
+ (FrameView):
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ (WebCore::Settings::setFixedElementsLayoutRelativeToFrame):
+ (WebCore):
+ * page/Settings.h:
+ (Settings):
+ (WebCore::Settings::fixedElementsLayoutRelativeToFrame):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::fixedElementLaysOutRelativeToFrame):
+ (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
+ (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
+ * rendering/RenderBox.h:
+ (RenderBox):
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::setFixedElementsLayoutRelativeToFrame):
+ * testing/InternalSettings.h:
+ (InternalSettings):
+ * testing/InternalSettings.idl:
+
2012-01-27 Kentaro Hara <haraken@chromium.org>
Support the [Supplemental] IDL for constants
__ZN7WebCore8Settings19setShowDebugBordersEb
__ZN7WebCore8Settings20setCursiveFontFamilyERKN3WTF12AtomicStringE11UScriptCode
__ZN7WebCore8Settings20setFantasyFontFamilyERKN3WTF12AtomicStringE11UScriptCode
+__ZN7WebCore8Settings37setFixedElementsLayoutRelativeToFrameEb
__ZN7WebCore8Settings20setXSSAuditorEnabledEb
__ZN7WebCore8Settings21mockScrollbarsEnabledEv
__ZN7WebCore8Settings21setShowRepaintCounterEb
__ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv
__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
__ZN7WebCore9FrameView38syncCompositingStateIncludingSubframesEv
-__ZN7WebCore9FrameView43setShouldLayoutFixedElementsRelativeToFrameEb
__ZN7WebCore9FrameView6createEPNS_5FrameE
__ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE
__ZN7WebCore9HTMLNames10listingTagE
m_cannotBlitToWindow = false;
m_isOverlapped = false;
m_contentIsOpaque = false;
- m_shouldLayoutFixedElementsRelativeToFrame = false;
m_borderX = 30;
m_borderY = 30;
m_layoutTimer.stop();
// When the page is scaled, the scaled "viewport" with respect to which fixed object are positioned
// doesn't move as fast as the content view, so that when the content is scrolled all the way to the
// end, the bottom of the scaled "viewport" touches the bottom of the real viewport.
- float dragFactor = shouldLayoutFixedElementsRelativeToFrame() ? 1 : (contentsWidth() - visibleContentWidth * frameScaleFactor) / maxX;
+ float dragFactor = fixedElementsLayoutRelativeToFrame() ? 1 : (contentsWidth() - visibleContentWidth * frameScaleFactor) / maxX;
return x * dragFactor / frameScaleFactor;
}
return y;
float frameScaleFactor = m_frame->frameScaleFactor();
- float dragFactor = shouldLayoutFixedElementsRelativeToFrame() ? 1 : (contentsHeight() - visibleContentHeight * frameScaleFactor) / maxY;
+ float dragFactor = fixedElementsLayoutRelativeToFrame() ? 1 : (contentsHeight() - visibleContentHeight * frameScaleFactor) / maxY;
return y * dragFactor / frameScaleFactor;
}
return IntSize(scrollXForFixedPosition(), scrollYForFixedPosition());
}
-void FrameView::setShouldLayoutFixedElementsRelativeToFrame(bool shouldLayoutFixedElementsRelativeToFrame)
+bool FrameView::fixedElementsLayoutRelativeToFrame() const
{
- if (shouldLayoutFixedElementsRelativeToFrame == m_shouldLayoutFixedElementsRelativeToFrame)
- return;
-
- m_shouldLayoutFixedElementsRelativeToFrame = shouldLayoutFixedElementsRelativeToFrame;
-
- if (!hasFixedObjects())
- return;
+ ASSERT(m_frame);
+ if (!m_frame->settings())
+ return false;
- setNeedsLayout();
+ return m_frame->settings()->fixedElementsLayoutRelativeToFrame();
}
+
IntPoint FrameView::currentMousePosition() const
{
return m_frame ? m_frame->eventHandler()->currentMousePosition() : IntPoint();
int scrollYForFixedPosition() const;
IntSize scrollOffsetForFixedPosition() const;
- bool shouldLayoutFixedElementsRelativeToFrame() const { return m_shouldLayoutFixedElementsRelativeToFrame; }
- void setShouldLayoutFixedElementsRelativeToFrame(bool);
+ bool fixedElementsLayoutRelativeToFrame() const;
void beginDeferredRepaints();
void endDeferredRepaints();
bool m_cannotBlitToWindow;
bool m_isOverlapped;
bool m_contentIsOpaque;
- bool m_shouldLayoutFixedElementsRelativeToFrame;
unsigned m_slowRepaintObjectCount;
unsigned m_fixedObjectCount;
int m_borderX;
, m_crossOriginCheckInGetMatchedCSSRulesDisabled(false)
, m_forceCompositingMode(false)
, m_shouldInjectUserScriptsInInitialEmptyDocument(false)
+ , m_fixedElementsLayoutRelativeToFrame(false)
, m_allowDisplayOfInsecureContent(true)
, m_allowRunningOfInsecureContent(true)
#if ENABLE(SMOOTH_SCROLLING)
m_page->userStyleSheetLocationChanged();
}
+void Settings::setFixedElementsLayoutRelativeToFrame(bool fixedElementsLayoutRelativeToFrame)
+{
+ m_fixedElementsLayoutRelativeToFrame = fixedElementsLayoutRelativeToFrame;
+}
+
void Settings::setShouldPrintBackgrounds(bool shouldPrintBackgrounds)
{
m_shouldPrintBackgrounds = shouldPrintBackgrounds;
void setUserStyleSheetLocation(const KURL&);
const KURL& userStyleSheetLocation() const { return m_userStyleSheetLocation; }
+ void setFixedElementsLayoutRelativeToFrame(bool);
+ bool fixedElementsLayoutRelativeToFrame() const { return m_fixedElementsLayoutRelativeToFrame; }
+
void setShouldPrintBackgrounds(bool);
bool shouldPrintBackgrounds() const { return m_shouldPrintBackgrounds; }
bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1;
bool m_forceCompositingMode : 1;
bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1;
+ bool m_fixedElementsLayoutRelativeToFrame : 1;
bool m_allowDisplayOfInsecureContent : 1;
bool m_allowRunningOfInsecureContent : 1;
#if ENABLE(SMOOTH_SCROLLING)
return result;
}
-bool RenderBox::shouldLayoutFixedElementRelativeToFrame(Frame* frame, FrameView* frameView) const
+bool RenderBox::fixedElementLaysOutRelativeToFrame(Frame* frame, FrameView* frameView) const
{
- return style() && style()->position() == FixedPosition && container()->isRenderView() && frame && frameView && frameView->shouldLayoutFixedElementsRelativeToFrame();
+ return style() && style()->position() == FixedPosition && container()->isRenderView() && frame && frameView && frameView->fixedElementsLayoutRelativeToFrame();
}
bool RenderBox::includeVerticalScrollbarSize() const
// Container for position:fixed is the frame.
Frame* frame = view() ? view()->frame(): 0;
FrameView* frameView = view() ? view()->frameView() : 0;
- if (shouldLayoutFixedElementRelativeToFrame(frame, frameView))
+ if (fixedElementLaysOutRelativeToFrame(frame, frameView))
return (view()->isHorizontalWritingMode() ? frameView->visibleWidth() : frameView->visibleHeight()) / frame->frameScaleFactor();
if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
{
Frame* frame = view() ? view()->frame(): 0;
FrameView* frameView = view() ? view()->frameView() : 0;
- if (shouldLayoutFixedElementRelativeToFrame(frame, frameView))
+ if (fixedElementLaysOutRelativeToFrame(frame, frameView))
return (view()->isHorizontalWritingMode() ? frameView->visibleHeight() : frameView->visibleWidth()) / frame->frameScaleFactor();
if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
void paintRootBoxFillLayers(const PaintInfo&);
private:
- bool shouldLayoutFixedElementRelativeToFrame(Frame*, FrameView*) const;
+ bool fixedElementLaysOutRelativeToFrame(Frame*, FrameView*) const;
bool includeVerticalScrollbarSize() const;
bool includeHorizontalScrollbarSize() const;
settings()->setPasswordEchoDurationInSeconds(durationInSeconds);
}
-void InternalSettings::setShouldLayoutFixedElementsRelativeToFrame(bool enabled, ExceptionCode& ec)
+void InternalSettings::setFixedElementsLayoutRelativeToFrame(bool enabled, ExceptionCode& ec)
{
InternalSettingsGuardForFrameView();
- frame()->view()->setShouldLayoutFixedElementsRelativeToFrame(enabled);
+ settings()->setFixedElementsLayoutRelativeToFrame(enabled);
}
void InternalSettings::setUnifiedTextCheckingEnabled(bool enabled, ExceptionCode& ec)
void setMockScrollbarsEnabled(bool enabled, ExceptionCode&);
void setPasswordEchoEnabled(bool enabled, ExceptionCode&);
void setPasswordEchoDurationInSeconds(double durationInSeconds, ExceptionCode&);
- void setShouldLayoutFixedElementsRelativeToFrame(bool, ExceptionCode&);
+ void setFixedElementsLayoutRelativeToFrame(bool, ExceptionCode&);
void setUnifiedTextCheckingEnabled(bool, ExceptionCode&);
bool unifiedTextCheckingEnabled(ExceptionCode&);
float pageScaleFactor(ExceptionCode&);
void setMockScrollbarsEnabled(in boolean enabled) raises(DOMException);
void setPasswordEchoEnabled(in boolean enabled) raises(DOMException);
void setPasswordEchoDurationInSeconds(in double durationInSeconds) raises(DOMException);
- void setShouldLayoutFixedElementsRelativeToFrame(in boolean enabled) raises(DOMException);
+ void setFixedElementsLayoutRelativeToFrame(in boolean enabled) raises(DOMException);
void setUnifiedTextCheckingEnabled(in boolean enabled) raises (DOMException);
boolean unifiedTextCheckingEnabled() raises (DOMException);
float pageScaleFactor() raises(DOMException);
+2012-01-27 Fady Samuel <fsamuel@chromium.org>
+
+ Rename shouldLayoutFixedElementsRelativeToFrame and make it a setting
+ https://bugs.webkit.org/show_bug.cgi?id=76459
+
+ Reviewed by Darin Fisher.
+
+ * public/WebSettings.h:
+ ():
+ * public/WebView.h:
+ (WebView):
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::setFixedElementsLayoutRelativeToFrame):
+ (WebKit):
+ * src/WebSettingsImpl.h:
+ (WebSettingsImpl):
+ * src/WebViewImpl.cpp:
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
2012-01-24 Vincent Scheib <scheib@chromium.org>
Pointer Lock: Implement pointer interface
virtual void setJavaScriptCanAccessClipboard(bool) = 0;
virtual void setXSSAuditorEnabled(bool) = 0;
virtual void setDNSPrefetchingEnabled(bool) = 0;
+ virtual void setFixedElementsLayoutRelativeToFrame(bool) = 0;
virtual void setLocalStorageEnabled(bool) = 0;
virtual void setEditableLinkBehaviorNeverLive() = 0;
virtual void setFrameFlatteningEnabled(bool) = 0;
// Sets the ratio as computed by computeViewportAttributes.
virtual void setDeviceScaleFactor(float) = 0;
- // Indicates whether position:fixed elements should be laid out relative
- // to the frame or relative to the page.
- virtual bool shouldLayoutFixedElementsRelativeToFrame() const = 0;
-
- // Sets the relative layout of position:fixed elements.
- virtual void setShouldLayoutFixedElementsRelativeToFrame(bool) = 0;
-
// Fixed Layout --------------------------------------------------------
m_settings->setDNSPrefetchingEnabled(enabled);
}
+void WebSettingsImpl::setFixedElementsLayoutRelativeToFrame(bool fixedElementsLayoutRelativeToFrame)
+{
+ m_settings->setFixedElementsLayoutRelativeToFrame(fixedElementsLayoutRelativeToFrame);
+}
+
void WebSettingsImpl::setLocalStorageEnabled(bool enabled)
{
m_settings->setLocalStorageEnabled(enabled);
virtual void setJavaScriptCanAccessClipboard(bool);
virtual void setXSSAuditorEnabled(bool);
virtual void setDNSPrefetchingEnabled(bool);
+ virtual void setFixedElementsLayoutRelativeToFrame(bool);
virtual void setLocalStorageEnabled(bool);
virtual void setEditableLinkBehaviorNeverLive();
virtual void setFrameFlatteningEnabled(bool);
page()->setDeviceScaleFactor(scaleFactor);
}
-bool WebViewImpl::shouldLayoutFixedElementsRelativeToFrame() const
-{
- if (!page())
- return false;
-
- Frame* frame = page()->mainFrame();
- if (!frame || !frame->view())
- return false;
-
- return frame->view()->shouldLayoutFixedElementsRelativeToFrame();
-}
-
-void WebViewImpl::setShouldLayoutFixedElementsRelativeToFrame(bool enable)
-{
- if (!page())
- return;
-
- Frame* frame = page()->mainFrame();
- if (!frame || !frame->view())
- return;
-
- frame->view()->setShouldLayoutFixedElementsRelativeToFrame(enable);
-}
-
bool WebViewImpl::isFixedLayoutModeEnabled() const
{
if (!page())
virtual float deviceScaleFactor() const;
virtual void setDeviceScaleFactor(float);
- virtual bool shouldLayoutFixedElementsRelativeToFrame() const;
- virtual void setShouldLayoutFixedElementsRelativeToFrame(bool);
virtual bool isFixedLayoutModeEnabled() const;
virtual void enableFixedLayoutMode(bool enable);
virtual WebSize fixedLayoutSize() const;
+2012-01-27 Fady Samuel <fsamuel@chromium.org>
+
+ Rename shouldLayoutFixedElementsRelativeToFrame and make it a setting
+ https://bugs.webkit.org/show_bug.cgi?id=76459
+
+ Reviewed by Darin Fisher.
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
2012-01-27 Martin Robinson <mrobinson@igalia.com>
Fix a compilation warning in a WebKit2 GTK+ API test.
?removeShadowRoot@Element@WebCore@@QAEXXZ
?scriptExecutionContext@JSDOMGlobalObject@WebCore@@QBEPAVScriptExecutionContext@2@XZ
?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
- ?setShouldLayoutFixedElementsRelativeToFrame@FrameView@WebCore@@QAEX_N@Z
?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
?setSuggestedValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?settings@Frame@WebCore@@QBEPAVSettings@2@XZ
+ ?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z
?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
?removeShadowRoot@Element@WebCore@@QAEXXZ
?scriptExecutionContext@JSDOMGlobalObject@WebCore@@QBEPAVScriptExecutionContext@2@XZ
?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
- ?setShouldLayoutFixedElementsRelativeToFrame@FrameView@WebCore@@QAEX_N@Z
?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
?setSuggestedValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?settings@Frame@WebCore@@QBEPAVSettings@2@XZ
+ ?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z
?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
_ZN7WebCore14ScrollableArea28setScrollOffsetFromInternalsERKNS_8IntPointE;
_ZN7WebCore10ScrollView23setScrollbarsSuppressedEbb;
_ZN7WebCore8Settings24setMockScrollbarsEnabledEb;
+_ZN7WebCore8Settings37setFixedElementsLayoutRelativeToFrameEb;
_ZN7WebCore9FrameView17paintControlTintsEv;
_ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE;
-_ZN7WebCore9FrameView43setShouldLayoutFixedElementsRelativeToFrameEb;
_ZN7WebCore24FrameDestructionObserverD2Ev;
_ZN7WebCore24FrameDestructionObserverC2EPNS_5FrameE;
_ZN7WebCore24FrameDestructionObserver12observeFrameEPNS_5FrameE;