Commit 03069c7c authored by nbarth@chromium.org's avatar nbarth@chromium.org

Cleanup [RuntimeEnabled] use in Window

This removes some cruft added in:
Bindings for CSSOM View smooth scroll API
https://codereview.chromium.org/146003002
...which was done b/c [RuntimeEnabled] didn't work properly on
overloaded methods.

This has been fixed (thanks Jens!) and thus the cruft can be removed.

R=haraken
BUG=339000

Review URL: https://codereview.chromium.org/329303009

git-svn-id: svn://svn.chromium.org/blink/trunk@176088 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2b9b9675
...@@ -33,8 +33,6 @@ Extends IdlType and IdlUnion type with |enum_validation_expression| property. ...@@ -33,8 +33,6 @@ Extends IdlType and IdlUnion type with |enum_validation_expression| property.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
""" """
# FIXME: eliminate this file if possible
import re import re
from idl_types import IdlType, IdlUnionType from idl_types import IdlType, IdlUnionType
...@@ -42,7 +40,18 @@ import idl_types ...@@ -42,7 +40,18 @@ import idl_types
from v8_globals import includes from v8_globals import includes
import v8_types import v8_types
ACRONYMS = ['CSS', 'HTML', 'IME', 'JS', 'SVG', 'URL', 'WOFF', 'XML', 'XSLT'] ACRONYMS = [
'CSSOM', # must come *before* CSS to match full acronym
'CSS',
'HTML',
'IME',
'JS',
'SVG',
'URL',
'WOFF',
'XML',
'XSLT',
]
################################################################################ ################################################################################
......
...@@ -1386,12 +1386,8 @@ static bool scrollBehaviorFromScrollOptions(const Dictionary& scrollOptions, Scr ...@@ -1386,12 +1386,8 @@ static bool scrollBehaviorFromScrollOptions(const Dictionary& scrollOptions, Scr
return false; return false;
} }
void DOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, ExceptionState &exceptionState) const void DOMWindow::scrollBy(int x, int y) const
{ {
ScrollBehavior scrollBehavior = ScrollBehaviorAuto;
if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && !scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState))
return;
if (!isCurrentlyDisplayedInFrame()) if (!isCurrentlyDisplayedInFrame())
return; return;
...@@ -1406,12 +1402,16 @@ void DOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, Exceptio ...@@ -1406,12 +1402,16 @@ void DOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, Exceptio
view->scrollBy(scaledOffset); view->scrollBy(scaledOffset);
} }
void DOMWindow::scrollTo(int x, int y, const Dictionary& scrollOptions, ExceptionState& exceptionState) const void DOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, ExceptionState &exceptionState) const
{ {
ScrollBehavior scrollBehavior = ScrollBehaviorAuto; ScrollBehavior scrollBehavior = ScrollBehaviorAuto;
if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && !scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState)) if (!scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState))
return; return;
scrollBy(x, y);
}
void DOMWindow::scrollTo(int x, int y) const
{
if (!isCurrentlyDisplayedInFrame()) if (!isCurrentlyDisplayedInFrame())
return; return;
...@@ -1426,6 +1426,14 @@ void DOMWindow::scrollTo(int x, int y, const Dictionary& scrollOptions, Exceptio ...@@ -1426,6 +1426,14 @@ void DOMWindow::scrollTo(int x, int y, const Dictionary& scrollOptions, Exceptio
view->setScrollPosition(layoutPos); view->setScrollPosition(layoutPos);
} }
void DOMWindow::scrollTo(int x, int y, const Dictionary& scrollOptions, ExceptionState& exceptionState) const
{
ScrollBehavior scrollBehavior = ScrollBehaviorAuto;
if (!scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState))
return;
scrollTo(x, y);
}
void DOMWindow::moveBy(float x, float y) const void DOMWindow::moveBy(float x, float y) const
{ {
if (!m_frame || !m_frame->isMainFrame()) if (!m_frame || !m_frame->isMainFrame())
......
...@@ -233,8 +233,11 @@ enum PageshowEventPersistence { ...@@ -233,8 +233,11 @@ enum PageshowEventPersistence {
void postMessageTimerFired(PassOwnPtr<PostMessageTimer>); void postMessageTimerFired(PassOwnPtr<PostMessageTimer>);
void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtrWillBeRawPtr<Event>, PassRefPtrWillBeRawPtr<ScriptCallStack>); void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtrWillBeRawPtr<Event>, PassRefPtrWillBeRawPtr<ScriptCallStack>);
void scrollBy(int x, int y) const;
void scrollBy(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const; void scrollBy(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const;
void scrollTo(int x, int y) const;
void scrollTo(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const; void scrollTo(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const;
void scroll(int x, int y) const { scrollTo(x, y); }
void scroll(int x, int y, const Dictionary& scrollOptions, ExceptionState& exceptionState) const { scrollTo(x, y, scrollOptions, exceptionState); } void scroll(int x, int y, const Dictionary& scrollOptions, ExceptionState& exceptionState) const { scrollTo(x, y, scrollOptions, exceptionState); }
void moveBy(float x, float y) const; void moveBy(float x, float y) const;
......
...@@ -96,17 +96,14 @@ ...@@ -96,17 +96,14 @@
readonly attribute long pageXOffset; readonly attribute long pageXOffset;
readonly attribute long pageYOffset; readonly attribute long pageYOffset;
// FIXME: should be: // Overloading can be replaced by optional if RuntimeEnabled is removed, by
// void scrollBy(long x, long y); // changing the third argument to *optional* Dictionary scrollOptions
// [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollBy(long x, long y, optional Dictionary scrollOptions); void scrollBy(long x, long y);
// void scrollTo(long x, long y); [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollBy(long x, long y, Dictionary scrollOptions);
// [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollTo(long x, long y, optional Dictionary scrollOptions); void scrollTo(long x, long y);
// void scroll(long x, long y); [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollTo(long x, long y, Dictionary scrollOptions);
// [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scroll(long x, long y, optional Dictionary scrollOptions); void scroll(long x, long y);
// http://crbug.com/339000 [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scroll(long x, long y, Dictionary scrollOptions);
[RaisesException] void scrollBy(long x, long y, optional Dictionary scrollOptions);
[RaisesException] void scrollTo(long x, long y, optional Dictionary scrollOptions);
[RaisesException] void scroll(long x, long y, optional Dictionary scrollOptions);
void moveBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. void moveBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats.
void moveTo([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. void moveTo([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats.
void resizeBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. void resizeBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment