Commit 41962c5f authored by weinig@apple.com's avatar weinig@apple.com

Reviewed by Mitz.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
        Move the JS Location object to its own file

        - Move Location into its own file and rename it JSLocation.

        * DerivedSources.make:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * bindings/js/JSDocumentCustom.cpp:
        * bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
        (WebCore::):
        (WebCore::JSLocation::JSLocation):
        (WebCore::JSLocation::getValueProperty):
        (WebCore::JSLocation::getOwnPropertySlot):
        (WebCore::JSLocation::put):
        (WebCore::JSLocationProtoFuncReplace::callAsFunction):
        (WebCore::JSLocationProtoFuncReload::callAsFunction):
        (WebCore::JSLocationProtoFuncAssign::callAsFunction):
        (WebCore::JSLocationProtoFuncToString::callAsFunction):
        * bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
        (WebCore::JSLocation::):
        (WebCore::JSLocation::frame):
        (WebCore::JSLocation::classInfo):
        * bindings/js/kjs_window.cpp:
        (KJS::Window::location):
        * bindings/js/kjs_window.h:
        * history/CachedPage.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a6f6cf8e
2007-12-16 Sam Weinig <sam@webkit.org>
Reviewed by Mitz.
Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
Move the JS Location object to its own file
- Move Location into its own file and rename it JSLocation.
* DerivedSources.make:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* bindings/js/JSDocumentCustom.cpp:
* bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
(WebCore::):
(WebCore::JSLocation::JSLocation):
(WebCore::JSLocation::getValueProperty):
(WebCore::JSLocation::getOwnPropertySlot):
(WebCore::JSLocation::put):
(WebCore::JSLocationProtoFuncReplace::callAsFunction):
(WebCore::JSLocationProtoFuncReload::callAsFunction):
(WebCore::JSLocationProtoFuncAssign::callAsFunction):
(WebCore::JSLocationProtoFuncToString::callAsFunction):
* bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
(WebCore::JSLocation::):
(WebCore::JSLocation::frame):
(WebCore::JSLocation::classInfo):
* bindings/js/kjs_window.cpp:
(KJS::Window::location):
* bindings/js/kjs_window.h:
* history/CachedPage.cpp:
2007-12-16 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
......
......@@ -409,6 +409,7 @@ all : \
JSHTMLVideoElement.h \
JSHistory.h \
JSKeyboardEvent.h \
JSLocation.lut.h \
JSMediaError.h \
JSMediaList.h \
JSMouseEvent.h \
......
......@@ -232,6 +232,7 @@ STYLESHEETS_EMBED = $$PWD/css/html4.css
LUT_FILES += \
bindings/js/JSDOMExceptionConstructor.cpp \
bindings/js/JSEventTargetBase.cpp \
bindings/js/JSLocation.cpp \
bindings/js/JSXMLHttpRequest.cpp \
bindings/js/JSXSLTProcessor.cpp \
bindings/js/kjs_css.cpp \
......@@ -398,6 +399,7 @@ SOURCES += \
bindings/js/JSHTMLOptionElementConstructor.cpp \
bindings/js/JSHTMLOptionsCollectionCustom.cpp \
bindings/js/JSHTMLSelectElementCustom.cpp \
bindings/js/JSLocation.cpp \
bindings/js/JSNamedNodeMapCustom.cpp \
bindings/js/JSNamedNodesCollection.cpp \
bindings/js/JSNodeCustom.cpp \
......
......@@ -1124,6 +1124,10 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSKeyboardEvent.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSLocation.lut.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMediaList.cpp"
>
......@@ -7463,6 +7467,14 @@
RelativePath="..\bindings\js\JSHTMLSelectElementCustom.h"
>
</File>
<File
RelativePath="..\bindings\js\JSLocation.cpp"
>
</File>
<File
RelativePath="..\bindings\js\JSLocation.h"
>
</File>
<File
RelativePath="..\bindings\js\JSNamedNodeMapCustom.cpp"
>
......
......@@ -3644,6 +3644,9 @@
BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */; };
BCA378160D15C64600B793D6 /* PausedTimeouts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA378140D15C64600B793D6 /* PausedTimeouts.cpp */; };
BCA378170D15C64600B793D6 /* PausedTimeouts.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378150D15C64600B793D6 /* PausedTimeouts.h */; };
BCA379140D163E5500B793D6 /* JSLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA379120D163E5500B793D6 /* JSLocation.cpp */; };
BCA379150D163E5500B793D6 /* JSLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA379130D163E5500B793D6 /* JSLocation.h */; };
BCA3793F0D1647E000B793D6 /* JSLocation.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA3793E0D1647E000B793D6 /* JSLocation.lut.h */; };
BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; };
BCAA90C30A7EBA60008B1229 /* ScrollBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */; };
BCB16B8B0979B01400467741 /* DeprecatedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16B880979B01400467741 /* DeprecatedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -7655,6 +7658,9 @@
BCA378150D15C64600B793D6 /* PausedTimeouts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PausedTimeouts.h; sourceTree = "<group>"; };
BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScheduledAction.cpp; sourceTree = "<group>"; };
BCA378BB0D15F64200B793D6 /* ScheduledAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScheduledAction.h; sourceTree = "<group>"; };
BCA379120D163E5500B793D6 /* JSLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLocation.cpp; sourceTree = "<group>"; };
BCA379130D163E5500B793D6 /* JSLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLocation.h; sourceTree = "<group>"; };
BCA3793E0D1647E000B793D6 /* JSLocation.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLocation.lut.h; sourceTree = "<group>"; };
BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGNumberInternal.h; sourceTree = "<group>"; };
BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ScrollBar.cpp; path = platform/ScrollBar.cpp; sourceTree = SOURCE_ROOT; };
BCB16B880979B01400467741 /* DeprecatedArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DeprecatedArray.h; sourceTree = "<group>"; };
......@@ -8216,6 +8222,7 @@
A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
A8D06B370A265DCD005E7203 /* HTMLNames.h */,
BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */,
BCA3793E0D1647E000B793D6 /* JSLocation.lut.h */,
656581DA09D1508D000E61D7 /* kjs_css.lut.h */,
656581DC09D1508D000E61D7 /* kjs_events.lut.h */,
656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */,
......@@ -11376,6 +11383,8 @@
A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */,
A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */,
A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */,
BCA379120D163E5500B793D6 /* JSLocation.cpp */,
BCA379130D163E5500B793D6 /* JSLocation.h */,
BCD9C26C0C17AA81005C90A2 /* JSNamedNodesCollection.cpp */,
BCD9C26D0C17AA81005C90A2 /* JSNamedNodesCollection.h */,
BCB7735E0C17853D00132BA4 /* JSNodeFilterCondition.cpp */,
......@@ -14107,6 +14116,8 @@
BCB16C2D0979C3BD00467741 /* loader.h in Headers */,
93309DF8099E64920056E581 /* markup.h in Headers */,
93309E1E099E64920056E581 /* visible_units.h in Headers */,
BCA379150D163E5500B793D6 /* JSLocation.h in Headers */,
BCA3793F0D1647E000B793D6 /* JSLocation.lut.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -15820,6 +15831,7 @@
BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */,
93309DF7099E64920056E581 /* markup.cpp in Sources */,
93309E1D099E64920056E581 /* visible_units.cpp in Sources */,
BCA379140D163E5500B793D6 /* JSLocation.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -70,6 +70,7 @@ This file contains the list of files needed to build WebCore.
bindings/js/JSHTMLOptionElementConstructor.cpp
bindings/js/JSHTMLOptionsCollectionCustom.cpp
bindings/js/JSHTMLSelectElementCustom.cpp
bindings/js/JSLocation.cpp
bindings/js/JSNamedNodeMapCustom.cpp
bindings/js/JSNamedNodesCollection.cpp
bindings/js/JSNodeCustom.cpp
......
......@@ -27,6 +27,7 @@
#include "HTMLDocument.h"
#include "JSDOMWindow.h"
#include "JSHTMLDocument.h"
#include "JSLocation.h"
#include "kjs_binding.h"
#include "kjs_proxy.h"
......
This diff is collapsed.
/*
* Copyright (C) 2000 Harri Porten (porten@kde.org)
* Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reseved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef JSLocation_h
#define JSLocation_h
#include "kjs_binding.h"
namespace KJS {
class Window;
}
namespace WebCore {
class Frame;
class JSLocation : public KJS::DOMObject {
friend class KJS::Window;
public:
virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);
KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;
virtual void put(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr = KJS::None);
enum {
Hash, Href, Hostname, Host,
Pathname, Port, Protocol, Search,
Replace, Reload, ToString, Assign
};
Frame* frame() const { return m_frame; }
virtual const KJS::ClassInfo* classInfo() const { return &info; }
static const KJS::ClassInfo info;
private:
JSLocation(Frame*);
Frame* m_frame;
};
#define FOR_EACH_CLASS(macro) \
macro(JSLocationProtoFuncAssign) \
macro(JSLocationProtoFuncToString) \
macro(JSLocationProtoFuncReplace) \
macro(JSLocationProtoFuncReload) \
FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
#undef FOR_EACH_CLASS
} // namespace WebCore
#endif // JSLocation_h
This diff is collapsed.
......@@ -32,7 +32,9 @@ namespace WebCore {
class DOMWindow;
class Frame;
class JSEventListener;
class JSLocation;
class JSUnprotectedEventListener;
class Location;
class PausedTimeouts;
class ScheduledAction;
}
......@@ -40,14 +42,13 @@ namespace WebCore {
namespace KJS {
class DOMWindowTimer;
class Location;
class Window;
class WindowFunc;
class WindowPrivate;
// This is the only WebCore JS binding which does not inherit from DOMObject
class Window : public JSGlobalObject {
friend class Location;
friend class WebCore::JSLocation;
friend class WebCore::ScheduledAction;
protected:
Window(WebCore::DOMWindow*);
......@@ -85,7 +86,7 @@ namespace KJS {
void timerFired(DOMWindowTimer*);
Location* location() const;
WebCore::JSLocation* location() const;
// Finds a wrapper of a JS EventListener, returns 0 if no existing one.
WebCore::JSEventListener* findJSEventListener(JSValue*, bool html = false);
......@@ -173,37 +174,6 @@ namespace KJS {
macro(WindowProtoFuncShowModalDialog) \
macro(WindowProtoFuncNotImplemented) \
FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
#undef FOR_EACH_CLASS
class Location : public DOMObject {
friend class Window;
public:
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
JSValue* getValueProperty(ExecState*, int token) const;
virtual void put(ExecState*, const Identifier& propertyName, JSValue*, int attr = None);
enum { Hash, Href, Hostname, Host, Pathname, Port, Protocol, Search,
Replace, Reload, ToString, Assign };
WebCore::Frame* frame() const { return m_frame; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
private:
Location(WebCore::Frame*);
WebCore::Frame* m_frame;
};
#define FOR_EACH_CLASS(macro) \
macro(LocationProtoFuncAssign) \
macro(LocationProtoFuncToString) \
macro(LocationProtoFuncReplace) \
macro(LocationProtoFuncReload) \
FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE)
#undef FOR_EACH_CLASS
......
......@@ -36,6 +36,7 @@
#include "FrameLoader.h"
#include "FrameView.h"
#include "GCController.h"
#include "JSLocation.h"
#include "Logging.h"
#include "Page.h"
#include "PausedTimeouts.h"
......
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