2006-04-02 Eric Seidel <eseidel@apple.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Apr 2006 12:13:27 +0000 (12:13 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Apr 2006 12:13:27 +0000 (12:13 +0000)
        Reviewed by andersca.

        Make WebCore safe against KJS::Node in JavaScriptCore private headers.

        * editing/ReplaceSelectionCommand.h:
        * khtml/ecma/JSXMLSerializer.cpp:
        (KJS::XMLSerializerProtoFunc::callAsFunction):
        * khtml/ecma/JSXSLTProcessor.cpp:
        (KJS::XSLTProcessorProtoFunc::callAsFunction):
        * khtml/ecma/kjs_binding.cpp:
        (KJS::ScriptInterpreter::forgetDOMNodeForDocument):
        (KJS::ScriptInterpreter::putDOMNodeForDocument):
        * khtml/ecma/kjs_dom.cpp:
        (KJS::DOMNode::DOMNode):
        (KJS::DOMNode::mark):
        (KJS::DOMNode::getValueProperty):
        (KJS::DOMNode::putValueProperty):
        (KJS::DOMNodeProtoFunc::callAsFunction):
        (KJS::toNode):
        (KJS::DOMEventTargetNode::DOMEventTargetNode):
        (KJS::DOMDocumentProtoFunc::callAsFunction):
        (KJS::DOMElement::putValueProperty):
        (KJS::DOMElementProtoFunc::callAsFunction):
        (KJS::checkNodeSecurity):
        (KJS::toJS):
        (KJS::getRuntimeObject):
        (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
        (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
        * khtml/ecma/kjs_events.cpp:
        (KJS::JSLazyEventListener::JSLazyEventListener):
        (KJS::ClipboardProtoFunc::callAsFunction):
        * khtml/ecma/kjs_html.cpp:
        (KJS::JSHTMLDocument::namedItemGetter):
        (KJS::JSHTMLElement::framesetNameGetter):
        (KJS::JSHTMLElement::getOwnPropertySlot):
        (KJS::JSHTMLElement::pushEventHandlerScope):
        (KJS::JSHTMLCollection::callAsFunction):
        (KJS::JSHTMLCollection::getNamedItems):
        (KJS::JSHTMLSelectCollection::put):
        * khtml/ecma/kjs_traversal.cpp:
        (KJS::JSNodeFilterCondition::acceptNode):
        * khtml/ecma/kjs_window.cpp:
        (KJS::Window::put):
        * kwq/KWQPageState.mm:
        (-[KWQPageState WebCore::]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13637 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/editing/ReplaceSelectionCommand.h
WebCore/khtml/ecma/JSXMLSerializer.cpp
WebCore/khtml/ecma/JSXSLTProcessor.cpp
WebCore/khtml/ecma/kjs_binding.cpp
WebCore/khtml/ecma/kjs_dom.cpp
WebCore/khtml/ecma/kjs_events.cpp
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/ecma/kjs_traversal.cpp
WebCore/khtml/ecma/kjs_window.cpp
WebCore/kwq/KWQPageState.mm

index de6716ef710002374ab61d365eae5abd786ae7c8..735d62d3c3a51383a815cd4f7ced53e47587f929 100644 (file)
@@ -1,3 +1,51 @@
+2006-04-02  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by andersca.
+
+        Make WebCore safe against KJS::Node in JavaScriptCore private headers.
+
+        * editing/ReplaceSelectionCommand.h:
+        * khtml/ecma/JSXMLSerializer.cpp:
+        (KJS::XMLSerializerProtoFunc::callAsFunction):
+        * khtml/ecma/JSXSLTProcessor.cpp:
+        (KJS::XSLTProcessorProtoFunc::callAsFunction):
+        * khtml/ecma/kjs_binding.cpp:
+        (KJS::ScriptInterpreter::forgetDOMNodeForDocument):
+        (KJS::ScriptInterpreter::putDOMNodeForDocument):
+        * khtml/ecma/kjs_dom.cpp:
+        (KJS::DOMNode::DOMNode):
+        (KJS::DOMNode::mark):
+        (KJS::DOMNode::getValueProperty):
+        (KJS::DOMNode::putValueProperty):
+        (KJS::DOMNodeProtoFunc::callAsFunction):
+        (KJS::toNode):
+        (KJS::DOMEventTargetNode::DOMEventTargetNode):
+        (KJS::DOMDocumentProtoFunc::callAsFunction):
+        (KJS::DOMElement::putValueProperty):
+        (KJS::DOMElementProtoFunc::callAsFunction):
+        (KJS::checkNodeSecurity):
+        (KJS::toJS):
+        (KJS::getRuntimeObject):
+        (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
+        (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
+        * khtml/ecma/kjs_events.cpp:
+        (KJS::JSLazyEventListener::JSLazyEventListener):
+        (KJS::ClipboardProtoFunc::callAsFunction):
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::JSHTMLDocument::namedItemGetter):
+        (KJS::JSHTMLElement::framesetNameGetter):
+        (KJS::JSHTMLElement::getOwnPropertySlot):
+        (KJS::JSHTMLElement::pushEventHandlerScope):
+        (KJS::JSHTMLCollection::callAsFunction):
+        (KJS::JSHTMLCollection::getNamedItems):
+        (KJS::JSHTMLSelectCollection::put):
+        * khtml/ecma/kjs_traversal.cpp:
+        (KJS::JSNodeFilterCondition::acceptNode):
+        * khtml/ecma/kjs_window.cpp:
+        (KJS::Window::put):
+        * kwq/KWQPageState.mm:
+        (-[KWQPageState WebCore::]):
+
 2006-04-01  Darin Adler  <darin@apple.com>
 
         Reviewed by Eric.
index 16df6e9e1c55ec1a95baa0702bb33be3a3b17b25..3e8724b0de8e686ee3d9852b371e459a391764ac 100644 (file)
@@ -46,7 +46,7 @@ private:
     bool m_isBlockFlow;
 };
 
-typedef Vector<RefPtr<Node> > NodeVector;
+typedef Vector<RefPtr<WebCore::Node> > NodeVector;
 typedef HashMap<Node*, RefPtr<RenderingInfo> > RenderingInfoMap;
 
 // --- ReplacementFragment helper class
index bb22d09c98a828d63280f06a557492877d456607..7c342830b4797e2818f60d56002d7c17ec87ef8d 100644 (file)
@@ -83,7 +83,7 @@ JSValue *XMLSerializerProtoFunc::callAsFunction(ExecState *exec, JSObject *thisO
         return jsUndefined();
       }
 
-      Node *node = static_cast<Node *>(static_cast<DOMNode *>(args[0]->toObject(exec))->impl());
+      WebCore::Node* node = static_cast<WebCore::Node*>(static_cast<DOMNode*>(args[0]->toObject(exec))->impl());
       return jsStringOrNull(WebCore::createMarkup(node));
     }
   }
index d34f35b0077460a78d6a1ca7d80904dc6014ec6f..9bea0e6f90bf0f8b26cb43f89d634ac7fa686742 100644 (file)
@@ -89,7 +89,7 @@ JSValue *XSLTProcessorProtoFunc::callAsFunction(ExecState *exec, JSObject *thisO
             JSValue *nodeVal = args[0];
             JSValue *docVal = args[1];
             if (nodeVal->isObject(&DOMNode::info) && docVal->isObject(&DOMDocument::info)) {
-                Node* node = static_cast<DOMNode *>(nodeVal)->impl();
+                WebCore::Node* node = static_cast<DOMNode *>(nodeVal)->impl();
                 Document* doc = static_cast<Document*>(static_cast<DOMDocument *>(docVal)->impl());
                 return toJS(exec, processor.transformToFragment(node, doc).get());
             }
index 3472d5cd854e36d3190bf47040e42621f7133f5e..a6fa3b4412f0388904033dbc0ae26211cc058f1e 100644 (file)
@@ -48,7 +48,7 @@ UString DOMObject::toString(ExecState *) const
 }
 
 typedef HashMap<void*, DOMObject*> DOMObjectMap;
-typedef HashMap<Node*, DOMNode*> NodeMap;
+typedef HashMap<WebCore::Node*, DOMNode*> NodeMap;
 typedef HashMap<Document*, NodeMap*> NodePerDocMap;
 
 static DOMObjectMap *domObjects()
@@ -99,7 +99,7 @@ DOMNode *ScriptInterpreter::getDOMNodeForDocument(WebCore::Document *document, W
     return NULL;
 }
 
-void ScriptInterpreter::forgetDOMNodeForDocument(WebCore::Document *document, Node *node)
+void ScriptInterpreter::forgetDOMNodeForDocument(WebCore::Document *document, WebCore::Node *node)
 {
     if (!document) {
         domObjects()->remove(node);
@@ -110,7 +110,7 @@ void ScriptInterpreter::forgetDOMNodeForDocument(WebCore::Document *document, No
         documentDict->remove(node);
 }
 
-void ScriptInterpreter::putDOMNodeForDocument(WebCore::Document *document, Node *nodeHandle, DOMNode *nodeWrapper)
+void ScriptInterpreter::putDOMNodeForDocument(WebCore::Document *document, WebCore::Node *nodeHandle, DOMNode *nodeWrapper)
 {
     if (!document) {
         domObjects()->set(nodeHandle, nodeWrapper);
index b96576436f4df6018179769dcbe4725e5ada22b9..5fcf1d6f5e87cfb7dff0adb44ed35c07c6de604c 100644 (file)
@@ -96,13 +96,13 @@ KJS_IMPLEMENT_PROTOTYPE("DOMNode", DOMNodeProto, DOMNodeProtoFunc)
 
 const ClassInfo DOMNode::info = { "Node", 0, &DOMNodeTable, 0 };
 
-DOMNode::DOMNode(ExecState *exec, Node *n)
+DOMNode::DOMNode(ExecState *exec, WebCore::Node* n)
   : m_impl(n)
 {
   setPrototype(DOMNodeProto::self(exec));
 }
 
-DOMNode::DOMNode(Node *n)
+DOMNode::DOMNode(WebCore::Node* n)
   : m_impl(n)
 {
 }
@@ -116,7 +116,7 @@ void DOMNode::mark()
 {
   assert(!marked());
 
-  Node *node = m_impl.get();
+  WebCore::Node* node = m_impl.get();
 
   // Nodes in the document are kept alive by ScriptInterpreter::mark,
   // so we have no special responsibilities and can just call the base class here.
@@ -127,12 +127,12 @@ void DOMNode::mark()
 
   // This is a node outside the document, so find the root of the tree it is in,
   // and start marking from there.
-  Node *root = node;
-  for (Node *current = m_impl.get(); current; current = current->parentNode()) {
+  WebCore::Node* root = node;
+  for (WebCore::Node* current = m_impl.get(); current; current = current->parentNode()) {
     root = current;
   }
 
-  static HashSet<Node*> markingRoots;
+  static HashSet<WebCore::Node*> markingRoots;
 
   // If we're already marking this tree, then we can simply mark this wrapper
   // by calling the base class; our caller is iterating the tree.
@@ -143,7 +143,7 @@ void DOMNode::mark()
 
   // Mark the whole tree; use the global set of roots to avoid reentering.
   markingRoots.add(root);
-  for (Node *nodeToMark = root; nodeToMark; nodeToMark = nodeToMark->traverseNextNode()) {
+  for (WebCore::Node* nodeToMark = root; nodeToMark; nodeToMark = nodeToMark->traverseNextNode()) {
     DOMNode *wrapper = ScriptInterpreter::getDOMNodeForDocument(m_impl->document(), nodeToMark);
     if (wrapper) {
       if (!wrapper->marked())
@@ -198,7 +198,7 @@ bool DOMNode::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName
 
 JSValue *DOMNode::getValueProperty(ExecState *exec, int token) const
 {
-  Node &node = *m_impl;
+  WebCore::Node& node = *m_impl;
   switch (token) {
   case NodeName:
     return jsStringOrNull(node.nodeName());
@@ -244,7 +244,7 @@ void DOMNode::put(ExecState *exec, const Identifier& propertyName, JSValue *valu
 void DOMNode::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
 {
   DOMExceptionTranslator exception(exec);
-  Node &node = *m_impl;
+  WebCore::Node& node = *m_impl;
   switch (token) {
   case NodeValue:
     node.setNodeValue(value->toString(exec), exception);
@@ -278,7 +278,7 @@ JSValue *DOMNodeProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, co
   if (!thisObj->inherits(&DOMNode::info))
     return throwError(exec, TypeError);
   DOMExceptionTranslator exception(exec);
-  Node &node = *static_cast<DOMNode *>(thisObj)->impl();
+  WebCore::Node& node = *static_cast<DOMNode*>(thisObj)->impl();
   switch (id) {
     case DOMNode::HasAttributes:
       return jsBoolean(node.hasAttributes());
@@ -332,7 +332,7 @@ EventTargetNode *toEventTargetNode(JSValue *val)
     return static_cast<EventTargetNode*>(static_cast<DOMEventTargetNode *>(val)->impl());
 }
 
-Node *toNode(JSValue *val)
+WebCore::Node* toNode(JSValue* val)
 {
     if (!val || !val->isObject(&DOMNode::info))
         return 0;
@@ -388,12 +388,12 @@ onunload      DOMEventTargetNode::OnUnload               DontDelete
 @end
 */
 
-DOMEventTargetNode::DOMEventTargetNode(Node* n)
+DOMEventTargetNode::DOMEventTargetNode(WebCore::Node* n)
     : DOMNode(n)
 {
 }
 
-DOMEventTargetNode::DOMEventTargetNode(ExecState *exec, Node *n)
+DOMEventTargetNode::DOMEventTargetNode(ExecState* exec, WebCore::Node* n)
     : DOMNode(n)
 {
     setPrototype(DOMEventTargetNodeProto::self(exec));
@@ -945,7 +945,7 @@ JSValue *DOMDocumentProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj
   if (!thisObj->inherits(&KJS::DOMDocument::info))
     return throwError(exec, TypeError);
   DOMExceptionTranslator exception(exec);
-  Node &node = *static_cast<DOMNode *>(thisObj)->impl();
+  WebCore::Node& node = *static_cast<DOMNode*>(thisObj)->impl();
   Document &doc = static_cast<Document &>(node);
   UString str = args[0]->toString(exec);
   WebCore::String s = str;
@@ -1142,7 +1142,7 @@ void DOMElement::put(ExecState *exec, const Identifier& propertyName, JSValue *v
 
 void DOMElement::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
 {
-    Node &node = *m_impl;
+    WebCore::Node& node = *m_impl;
     switch (token) {
         case ScrollTop: {
             RenderObject *rend = node.renderer();
@@ -1199,7 +1199,7 @@ JSValue *DOMElementProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj,
   if (!thisObj->inherits(&KJS::DOMElement::info))
     return throwError(exec, TypeError);
   DOMExceptionTranslator exception(exec);
-  Node &node = *static_cast<DOMNode *>(thisObj)->impl();
+  WebCore::Node& node = *static_cast<DOMNode*>(thisObj)->impl();
   Element &element = static_cast<Element &>(node);
 
   switch(id) {
@@ -1373,7 +1373,7 @@ JSValue* toJS(ExecState *exec, Document *n)
   return ret;
 }
 
-bool checkNodeSecurity(ExecState *exec, Node *n)
+bool checkNodeSecurity(ExecState* exec, WebCore::Node* n)
 {
   if (!n) 
     return false;
@@ -1383,9 +1383,9 @@ bool checkNodeSecurity(ExecState *exec, Node *n)
   return win && win->isSafeScript(exec);
 }
 
-JSValue *toJS(ExecState *exec, PassRefPtr<Node> node)
+JSValue *toJS(ExecState *exec, PassRefPtr<WebCore::Node> node)
 {
-  Node* n = node.get();
+  WebCore::Node* n = node.get();
   DOMNode *ret = 0;
   if (!n)
     return jsNull();
@@ -1443,7 +1443,7 @@ JSValue *toJS(ExecState *exec, NamedNodeMap *m)
   return cacheDOMObject<NamedNodeMap, DOMNamedNodeMap>(exec, m);
 }
 
-JSValue *getRuntimeObject(ExecState *exec, Node *n)
+JSValue *getRuntimeObject(ExecState* exec, WebCore::Node* n)
 {
     if (!n)
         return 0;
@@ -1556,7 +1556,7 @@ JSObject *getDOMExceptionConstructor(ExecState *exec)
 // Such a collection is usually very short-lived, it only exists
 // for constructs like document.forms.<name>[1],
 // so it shouldn't be a problem that it's storing all the nodes (with the same name). (David)
-DOMNamedNodesCollection::DOMNamedNodesCollection(ExecState *, const DeprecatedValueList< RefPtr<Node> >& nodes )
+DOMNamedNodesCollection::DOMNamedNodesCollection(ExecState *, const DeprecatedValueList< RefPtr<WebCore::Node> >& nodes )
   : m_nodes(nodes)
 {
 }
@@ -1592,10 +1592,10 @@ bool DOMNamedNodesCollection::getOwnPropertySlot(ExecState *exec, const Identifi
   // document.formName.name result by id as well as be index.
 
   AtomicString atomicPropertyName = propertyName;
-  DeprecatedValueListConstIterator< RefPtr<Node> > end = m_nodes.end();
+  DeprecatedValueListConstIterator< RefPtr<WebCore::Node> > end = m_nodes.end();
   int i = 0;
-  for (DeprecatedValueListConstIterator< RefPtr<Node> > it = m_nodes.begin(); it != end; ++it, ++i) {
-    Node *node = (*it).get();
+  for (DeprecatedValueListConstIterator< RefPtr<WebCore::Node> > it = m_nodes.begin(); it != end; ++it, ++i) {
+    WebCore::Node* node = (*it).get();
     if (node->hasAttributes() && node->attributes()->id() == atomicPropertyName) {
       slot.setCustomIndex(this, i, indexGetter);
       return true;
index 356157d96dc08a4035f614f860a8b5809c9ef88f..d8170ed75109548987c89a62fb1a36c13e60a45b 100644 (file)
@@ -212,7 +212,7 @@ void JSEventListener::clearWindowObj()
 
 // -------------------------------------------------------------------------
 
-JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& code, Window* win, Node* node, int lineno)
+JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& code, Window* win, WebCore::Node* node, int lineno)
   : JSEventListener(0, win, true)
   , m_functionName(functionName)
   , code(code)
@@ -667,7 +667,7 @@ JSValue *ClipboardProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj,
             int y = (int)args[2]->toNumber(exec);
 
             // See if they passed us a node
-            Node *node = toNode(args[0]);
+            WebCore::Node *node = toNode(args[0]);
             if (!node)
                 return throwError(exec, TypeError);
             
index a084d019d077229744e465182482580bebe907b1..4e12bf34a34a721013c44302e33a1a2e8276a560 100644 (file)
@@ -197,7 +197,7 @@ JSValue *JSHTMLDocument::namedItemGetter(ExecState *exec, JSObject *originalObje
   RefPtr<WebCore::HTMLCollection> collection = doc.documentNamedItems(name);
 
   if (collection->length() == 1) {
-    Node* node = collection->firstItem();
+    WebCore::Node* node = collection->firstItem();
     Frame *frame;
     if (node->hasTagName(iframeTag) && (frame = static_cast<WebCore::HTMLIFrameElement *>(node)->contentFrame()))
       return Window::retrieve(frame);
@@ -1210,7 +1210,7 @@ JSValue *JSHTMLElement::framesetNameGetter(ExecState *exec, JSObject *originalOb
     JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
     HTMLElement *element = static_cast<HTMLElement *>(thisObj->impl());
 
-    Node *frame = element->children()->namedItem(propertyName);
+    WebCore::Node *frame = element->children()->namedItem(propertyName);
     if (Document* doc = static_cast<HTMLFrameElement *>(frame)->contentDocument())
         if (Window *window = Window::retrieveWindow(doc->frame()))
             return window;
@@ -1266,7 +1266,7 @@ bool JSHTMLElement::getOwnPropertySlot(ExecState *exec, const Identifier& proper
             return true;
         }
     } else if (element.hasLocalName(framesetTag)) {
-        Node *frame = element.children()->namedItem(propertyName);
+        WebCore::Node *frame = element.children()->namedItem(propertyName);
         if (frame && frame->hasTagName(frameTag)) {
             slot.setCustom(this, framesetNameGetter);
             return true;
@@ -2205,7 +2205,7 @@ void JSHTMLElement::pushEventHandlerScope(ExecState *exec, ScopeChain &scope) co
   if (form)
     scope.push(static_cast<JSObject *>(toJS(exec, form)));
   else {
-    Node *form = element->parentNode();
+    WebCore::Node* form = element->parentNode();
     while (form && !form->hasTagName(formTag))
       form = form->parentNode();
     
@@ -3277,7 +3277,7 @@ JSValue *JSHTMLCollection::callAsFunction(ExecState *exec, JSObject *, const Lis
     if (ok)
     {
       WebCore::String pstr = s;
-      Node *node = collection.namedItem(pstr);
+      WebCore::Node *node = collection.namedItem(pstr);
       while (node) {
         if (!u)
           return toJS(exec,node);
@@ -3291,7 +3291,7 @@ JSValue *JSHTMLCollection::callAsFunction(ExecState *exec, JSObject *, const Lis
 
 JSValue *JSHTMLCollection::getNamedItems(ExecState *exec, const Identifier &propertyName) const
 {
-    DeprecatedValueList< RefPtr<Node> > namedItems = m_impl->namedItems(propertyName);
+    DeprecatedValueList< RefPtr<WebCore::Node> > namedItems = m_impl->namedItems(propertyName);
 
     if (namedItems.isEmpty())
         return jsUndefined();
@@ -3395,7 +3395,7 @@ void JSHTMLSelectCollection::put(ExecState *exec, const Identifier &propertyName
   }
 
   // is v an option element ?
-  Node *option = toNode(value);
+  WebCore::Node *option = toNode(value);
   if (!option || !option->hasTagName(optionTag))
     return;
 
index 212e976040c5d6e0883e0982eed559ff2b2ad8ff..1ecdde2cb69ab2a6c124b6a51e3921549392ede2 100644 (file)
@@ -329,9 +329,9 @@ void JSNodeFilterCondition::mark()
     filter->mark();
 }
 
-short JSNodeFilterCondition::acceptNode(Node* filterNode) const
+short JSNodeFilterCondition::acceptNode(WebCore::Node* filterNode) const
 {
-    Node *node = filterNode;
+    WebCore::Node *node = filterNode;
     Frame *frame = node->document()->frame();
     KJSProxy *proxy = frame->jScript();
     if (proxy && filter->implementsCall()) {
index 2508c78f5512b38bb17a2753813f0681e5efd062..f4efa92bf41da4dcb151a78fc57d5f0216a3eeda 100644 (file)
@@ -1014,18 +1014,16 @@ void Window::put(ExecState* exec, const Identifier &propertyName, JSValue *value
 {
   // Called by an internal KJS call (e.g. InterpreterImp's constructor) ?
   // If yes, save time and jump directly to JSObject.
-  if ( (attr != None && attr != DontDelete)
+  if ((attr != None && attr != DontDelete)
        // Same thing if we have a local override (e.g. "var location")
-       || ( JSObject::getDirect(propertyName) && isSafeScript(exec)) )
-  {
+       || (JSObject::getDirect(propertyName) && isSafeScript(exec))) {
     JSObject::put( exec, propertyName, value, attr );
     return;
   }
 
   const HashEntry* entry = Lookup::findEntry(&WindowTable, propertyName);
-  if (entry)
-  {
-    switch( entry->value ) {
+  if (entry) {
+    switch(entry->value) {
     case Status:
       m_frame->setJSStatusBarText(value->toString(exec));
       return;
@@ -1036,8 +1034,7 @@ void Window::put(ExecState* exec, const Identifier &propertyName, JSValue *value
       Frame* p = Window::retrieveActive(exec)->m_frame;
       if (p) {
         DeprecatedString dstUrl = p->document()->completeURL(DeprecatedString(value->toString(exec)));
-        if (!dstUrl.startsWith("javascript:", false) || isSafeScript(exec))
-        {
+        if (!dstUrl.startsWith("javascript:", false) || isSafeScript(exec)) {
           bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
           // We want a new history item if this JS was called via a user gesture
           m_frame->scheduleLocationChange(dstUrl, p->referrer(), !userGesture, userGesture);
@@ -1161,9 +1158,8 @@ void Window::put(ExecState* exec, const Identifier &propertyName, JSValue *value
       break;
     }
   }
-  if (isSafeScript(exec)) {
+  if (isSafeScript(exec))
     JSObject::put(exec, propertyName, value, attr);
-  }
 }
 
 bool Window::toBoolean(ExecState *) const
index a652e1778e383f78d7661f01301d0c7e47a35d7f..d5c94e06f088b898c60240a06f3b1a3d7de18e68 100644 (file)
@@ -181,7 +181,7 @@ using namespace KJS;
     return document;
 }
 
-- (Node *)mousePressNode
+- (WebCore::Node *)mousePressNode
 {
     return mousePressNode;
 }