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.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
# FIXME: eliminate this file if possible
import re
from idl_types import IdlType, IdlUnionType
......@@ -42,7 +40,18 @@ import idl_types
from v8_globals import includes
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
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())
return;
......@@ -1406,12 +1402,16 @@ void DOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, Exceptio
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;
if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && !scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState))
if (!scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState))
return;
scrollBy(x, y);
}
void DOMWindow::scrollTo(int x, int y) const
{
if (!isCurrentlyDisplayedInFrame())
return;
......@@ -1426,6 +1426,14 @@ void DOMWindow::scrollTo(int x, int y, const Dictionary& scrollOptions, Exceptio
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
{
if (!m_frame || !m_frame->isMainFrame())
......
......@@ -233,8 +233,11 @@ enum PageshowEventPersistence {
void postMessageTimerFired(PassOwnPtr<PostMessageTimer>);
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 scrollTo(int x, int y) 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 moveBy(float x, float y) const;
......
......@@ -96,17 +96,14 @@
readonly attribute long pageXOffset;
readonly attribute long pageYOffset;
// FIXME: should be:
// void scrollBy(long x, long y);
// [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollBy(long x, long y, optional Dictionary scrollOptions);
// void scrollTo(long x, long y);
// [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollTo(long x, long y, optional Dictionary scrollOptions);
// void scroll(long x, long y);
// [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scroll(long x, long y, optional Dictionary scrollOptions);
// http://crbug.com/339000
[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);
// Overloading can be replaced by optional if RuntimeEnabled is removed, by
// changing the third argument to *optional* Dictionary scrollOptions
void scrollBy(long x, long y);
[RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollBy(long x, long y, Dictionary scrollOptions);
void scrollTo(long x, long y);
[RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollTo(long x, long y, Dictionary scrollOptions);
void scroll(long x, long y);
[RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scroll(long x, long y, Dictionary scrollOptions);
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 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