Remove more properties from the global Window.

StyleMedia seems to have been removed from the web too, and self is a
legacy-ism we don't want. I also removed the global find() which is a
document feature.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/872143004
This commit is contained in:
Elliott Sprehn 2015-01-26 15:12:04 -08:00
parent 865790aca0
commit ff2cde060f
7 changed files with 0 additions and 194 deletions

View File

@ -326,8 +326,6 @@ sky_core_files = [
"css/SelectorChecker.cpp",
"css/SelectorChecker.h",
"css/StyleColor.h",
"css/StyleMedia.cpp",
"css/StyleMedia.h",
"css/StylePropertySerializer.cpp",
"css/StylePropertySerializer.h",
"css/StylePropertySet.cpp",
@ -1214,7 +1212,6 @@ core_idl_files = get_path_info([
"css/MediaQueryListEvent.idl",
"css/Rect.idl",
"css/RGBColor.idl",
"css/StyleMedia.idl",
"dom/Attr.idl",
"dom/CharacterData.idl",
"dom/ClientRect.idl",

View File

@ -1,70 +0,0 @@
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "sky/engine/config.h"
#include "sky/engine/core/css/StyleMedia.h"
#include "sky/engine/core/css/MediaList.h"
#include "sky/engine/core/css/MediaQueryEvaluator.h"
#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/frame/FrameView.h"
#include "sky/engine/core/frame/LocalFrame.h"
namespace blink {
StyleMedia::StyleMedia(LocalFrame* frame)
: DOMWindowProperty(frame)
{
}
AtomicString StyleMedia::type() const
{
FrameView* view = m_frame ? m_frame->view() : 0;
if (view)
return view->mediaType();
return nullAtom;
}
bool StyleMedia::matchMedium(const String& query) const
{
if (!m_frame)
return false;
Document* document = m_frame->document();
ASSERT(document);
Element* documentElement = document->documentElement();
if (!documentElement)
return false;
RefPtr<MediaQuerySet> media = MediaQuerySet::create();
if (!media->set(query))
return false;
MediaQueryEvaluator screenEval(m_frame);
return screenEval.eval(media.get());
}
} // namespace blink

View File

@ -1,54 +0,0 @@
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SKY_ENGINE_CORE_CSS_STYLEMEDIA_H_
#define SKY_ENGINE_CORE_CSS_STYLEMEDIA_H_
#include "sky/engine/bindings/core/v8/ScriptWrappable.h"
#include "sky/engine/core/frame/DOMWindowProperty.h"
#include "sky/engine/platform/heap/Handle.h"
#include "sky/engine/wtf/RefCounted.h"
#include "sky/engine/wtf/text/WTFString.h"
namespace blink {
class LocalFrame;
class StyleMedia : public RefCounted<StyleMedia>, public DOMWindowProperty, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtr<StyleMedia> create(LocalFrame* frame) { return adoptRef(new StyleMedia(frame));}
AtomicString type() const;
bool matchMedium(const String&) const;
private:
explicit StyleMedia(LocalFrame*);
};
} // namespace blink
#endif // SKY_ENGINE_CORE_CSS_STYLEMEDIA_H_

View File

@ -1,32 +0,0 @@
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
NoInterfaceObject,
] interface StyleMedia {
readonly attribute DOMString type;
boolean matchMedium([Default=Undefined] optional DOMString mediaquery);
};

View File

@ -41,7 +41,6 @@
#include "sky/engine/core/css/DOMWindowCSS.h"
#include "sky/engine/core/css/MediaQueryList.h"
#include "sky/engine/core/css/MediaQueryMatcher.h"
#include "sky/engine/core/css/StyleMedia.h"
#include "sky/engine/core/css/resolver/StyleResolver.h"
#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/dom/Element.h"
@ -382,7 +381,6 @@ void LocalDOMWindow::resetDOMWindowProperties()
m_screen = nullptr;
m_console = nullptr;
m_location = nullptr;
m_media = nullptr;
#if ENABLE(ASSERT)
m_hasBeenReset = true;
#endif
@ -449,16 +447,6 @@ void LocalDOMWindow::focus(ExecutionContext* context)
m_frame->eventHandler().focusDocumentView();
}
bool LocalDOMWindow::find(const String& string, bool caseSensitive, bool backwards, bool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/) const
{
// |m_frame| can be destructed during |Editor::findString()| via
// |Document::updateLayou()|, e.g. event handler removes a frame.
RefPtr<LocalFrame> protectFrame(m_frame);
// FIXME (13016): Support wholeWord, searchInFrames and showDialog
return m_frame->editor().findString(string, !backwards, caseSensitive, wrap, false);
}
int LocalDOMWindow::outerHeight() const
{
if (!m_frame)
@ -544,13 +532,6 @@ Document* LocalDOMWindow::document() const
return m_document.get();
}
StyleMedia& LocalDOMWindow::styleMedia() const
{
if (!m_media)
m_media = StyleMedia::create(m_frame);
return *m_media;
}
PassRefPtr<CSSStyleDeclaration> LocalDOMWindow::getComputedStyle(Element* elt) const
{
if (!elt)

View File

@ -119,8 +119,6 @@ public:
void focus(ExecutionContext* = 0);
bool find(const String&, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const;
int outerHeight() const;
int outerWidth() const;
int innerHeight() const;
@ -132,7 +130,6 @@ public:
// FIXME(sky): keeping self for now since js-test.html uses it.
LocalDOMWindow* window() const;
LocalDOMWindow* self() const { return window(); }
// DOM Level 2 AbstractView Interface
@ -241,7 +238,6 @@ private:
mutable RefPtr<Screen> m_screen;
mutable RefPtr<Console> m_console;
mutable RefPtr<Location> m_location;
mutable RefPtr<StyleMedia> m_media;
mutable RefPtr<DOMWindowCSS> m_css;

View File

@ -40,14 +40,6 @@
[DoNotCheckSecurity, CallWith=ExecutionContext] void focus();
boolean find([Default=Undefined] optional DOMString string,
[Default=Undefined] optional boolean caseSensitive,
[Default=Undefined] optional boolean backwards,
[Default=Undefined] optional boolean wrap,
[Default=Undefined] optional boolean wholeWord,
[Default=Undefined] optional boolean searchInFrames,
[Default=Undefined] optional boolean showDialog);
[Replaceable] readonly attribute long outerHeight;
[Replaceable] readonly attribute long outerWidth;
[Replaceable] readonly attribute long innerHeight;
@ -63,7 +55,6 @@
void resizeTo([Default=Undefined] optional float width, [Default=Undefined] optional float height); // FIXME: this should take longs not floats.
// Self referential attributes
[Replaceable, DoNotCheckSecurity] readonly attribute Window self;
[DoNotCheckSecurity, Unforgeable] readonly attribute Window window;
// DOM Level 2 AbstractView Interface
@ -72,9 +63,6 @@
// CSSOM View Module
MediaQueryList matchMedia(DOMString query);
// styleMedia has been removed from the CSSOM View specification.
readonly attribute StyleMedia styleMedia;
// DOM Level 2 Style Interface
CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element);