[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:36:24 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d86d7e87e09f792fdc8c82e50ef058fff5280055
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Apr 23 15:13:41 2004 +0000

    WebCore:
    
            Reviewed by John
    
            Added some plumbing for applying styles.
    
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::createCSSStyleDeclaration): New factory method.
            * khtml/xml/dom_docimpl.h: Declare the above.
            * kwq/DOM-CSS.mm:
            (-[DOMCSSStyleDeclaration _styleDeclarationImpl]): Expose this in the
            WebCoreInternal category, "promoting" it from being private to the
            DOM-CSS.mm file.
            * kwq/DOM.mm: Add -(DOMCSSStyleDeclaration *)createCSSStyleDeclaration extension.
            * kwq/DOMExtensions.h: Delcare the above.
            * kwq/DOMInternal.h: Add _styleDeclarationImpl to WebCoreInternal category.
    
    WebKit:
    
            Reviewed by John
    
            Added some plumbing for applying styles.
    
            * DOM.subproj/DOMExtensions.h: Copied from WebCore.
            * WebView.subproj/WebView.m:
            (-[WebView DOMDocument]): Added new helper.
            (-[WebView styleDeclarationWithText:]): Added new helper.
            * WebView.subproj/WebViewPrivate.h: Declare above methods.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 255ec0d..937393b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2004-04-23  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by John
+
+        Added some plumbing for applying styles.
+
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::createCSSStyleDeclaration): New factory method.
+        * khtml/xml/dom_docimpl.h: Declare the above.
+        * kwq/DOM-CSS.mm:
+        (-[DOMCSSStyleDeclaration _styleDeclarationImpl]): Expose this in the
+        WebCoreInternal category, "promoting" it from being private to the 
+        DOM-CSS.mm file.
+        * kwq/DOM.mm: Add -(DOMCSSStyleDeclaration *)createCSSStyleDeclaration extension.
+        * kwq/DOMExtensions.h: Delcare the above.
+        * kwq/DOMInternal.h: Add _styleDeclarationImpl to WebCoreInternal category.
+
 2004-04-23  John Sullivan  <sullivan at apple.com>
 
         - fixed <rdar://problem/3631541>: "repro crash in KHTMLPart::setFocusNodeIfNeeded"
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index c98b9be..1b074d4 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -37,6 +37,7 @@
 #include "css/csshelper.h"
 #include "css/cssstyleselector.h"
 #include "css/css_stylesheetimpl.h"
+#include "css/css_valueimpl.h"
 #include "misc/htmlhashes.h"
 #include "misc/helper.h"
 #include "ecma/kjs_proxy.h"
@@ -467,6 +468,13 @@ EditingTextImpl *DocumentImpl::createEditingTextNode(const DOMString &text)
     return new EditingTextImpl(docPtr(), text);
 }
 
+CSSStyleDeclarationImpl *DocumentImpl::createCSSStyleDeclaration()
+{
+    QPtrList<CSSProperty> *propList = new QPtrList<CSSProperty>;
+    propList->setAutoDelete(true);
+    return new CSSStyleDeclarationImpl(0, propList);
+}
+
 NodeImpl *DocumentImpl::importNode(NodeImpl *importedNode, bool deep, int &exceptioncode)
 {
 	NodeImpl *result = 0;
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index b75ec12..c02774a 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -247,6 +247,7 @@ public:
                             bool entityReferenceExpansion);
 
     // Special support for editing
+    CSSStyleDeclarationImpl *createCSSStyleDeclaration();
     EditingTextImpl *createEditingTextNode(const DOMString &text);
 
     virtual void recalcStyle( StyleChange = NoChange );
diff --git a/WebCore/kwq/DOM-CSS.mm b/WebCore/kwq/DOM-CSS.mm
index 593d1df..40af954 100644
--- a/WebCore/kwq/DOM-CSS.mm
+++ b/WebCore/kwq/DOM-CSS.mm
@@ -697,11 +697,6 @@ static inline int getPropertyID(NSString *string)
     [super dealloc];
 }
 
-- (CSSStyleDeclarationImpl *)_styleDeclarationImpl
-{
-    return reinterpret_cast<CSSStyleDeclarationImpl *>(_internal);
-}
-
 - (NSString *)cssText
 {
     return [self _styleDeclarationImpl]->cssText();
@@ -796,6 +791,11 @@ static inline int getPropertyID(NSString *string)
     return [[[self alloc] _initWithStyleDeclarationImpl:impl] autorelease];
 }
 
+- (CSSStyleDeclarationImpl *)_styleDeclarationImpl
+{
+    return reinterpret_cast<CSSStyleDeclarationImpl *>(_internal);
+}
+
 @end
 
 //------------------------------------------------------------------------------------------
diff --git a/WebCore/kwq/DOM.mm b/WebCore/kwq/DOM.mm
index 9881196..313cf5f 100644
--- a/WebCore/kwq/DOM.mm
+++ b/WebCore/kwq/DOM.mm
@@ -1074,6 +1074,15 @@ inline Document DocumentImpl::createInstance(DocumentImpl *impl)
 
 @end
 
+ at implementation DOMDocument (DOMDocumentExtensions)
+
+- (DOMCSSStyleDeclaration *)createCSSStyleDeclaration;
+{
+    return [DOMCSSStyleDeclaration _styleDeclarationWithImpl:[self _documentImpl]->createCSSStyleDeclaration()];
+}
+
+ at end
+
 @implementation DOMDocument (WebCoreInternal)
 
 + (DOMDocument *)_documentWithImpl:(DocumentImpl *)impl
diff --git a/WebCore/kwq/DOMExtensions.h b/WebCore/kwq/DOMExtensions.h
index c33861a..c78e165 100644
--- a/WebCore/kwq/DOMExtensions.h
+++ b/WebCore/kwq/DOMExtensions.h
@@ -25,6 +25,8 @@
 
 #import "DOMHTML.h"
 
+ at class DOMCSSStyleDeclaration;
+
 @interface DOMHTMLEmbedElement : DOMHTMLElement
 - (NSString *)align;
 - (void)setAlign:(NSString *)align;
@@ -60,3 +62,7 @@
 - (NSString *)background;
 - (void)setBackground:(NSString *)background;
 @end
+
+ at interface DOMDocument (DOMDocumentExtensions)
+- (DOMCSSStyleDeclaration *)createCSSStyleDeclaration;
+ at end
diff --git a/WebCore/kwq/DOMInternal.h b/WebCore/kwq/DOMInternal.h
index dc68951..9c3f37c 100644
--- a/WebCore/kwq/DOMInternal.h
+++ b/WebCore/kwq/DOMInternal.h
@@ -66,6 +66,7 @@ namespace DOM {
 
 @interface DOMCSSStyleDeclaration (WebCoreInternal)
 + (DOMCSSStyleDeclaration *)_styleDeclarationWithImpl:(DOM::CSSStyleDeclarationImpl *)impl;
+- (DOM::CSSStyleDeclarationImpl *)_styleDeclarationImpl;
 @end
 
 @interface DOMStyleSheetList (WebCoreInternal)
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b33d14f..96df0ed 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2004-04-23  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by John
+
+        Added some plumbing for applying styles.
+
+        * DOM.subproj/DOMExtensions.h: Copied from WebCore.
+        * WebView.subproj/WebView.m:
+        (-[WebView DOMDocument]): Added new helper.
+        (-[WebView styleDeclarationWithText:]): Added new helper.
+        * WebView.subproj/WebViewPrivate.h: Declare above methods.
+
 2004-04-22  Richard Williamson   <rjw at apple.com>
 
 	Updates to plugin binding APIs.
diff --git a/WebKit/DOM.subproj/DOMExtensions.h b/WebKit/DOM.subproj/DOMExtensions.h
index c33861a..c78e165 100644
--- a/WebKit/DOM.subproj/DOMExtensions.h
+++ b/WebKit/DOM.subproj/DOMExtensions.h
@@ -25,6 +25,8 @@
 
 #import "DOMHTML.h"
 
+ at class DOMCSSStyleDeclaration;
+
 @interface DOMHTMLEmbedElement : DOMHTMLElement
 - (NSString *)align;
 - (void)setAlign:(NSString *)align;
@@ -60,3 +62,7 @@
 - (NSString *)background;
 - (void)setBackground:(NSString *)background;
 @end
+
+ at interface DOMDocument (DOMDocumentExtensions)
+- (DOMCSSStyleDeclaration *)createCSSStyleDeclaration;
+ at end
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index a20b809..589ef7a 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -6,6 +6,7 @@
 #import <WebKit/WebViewInternal.h>
 
 #import <WebKit/DOM.h>
+#import <WebKit/DOMExtensions.h>
 #import <WebKit/WebAssertions.h>
 #import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebBaseNetscapePluginView.h>
@@ -2177,6 +2178,21 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     return _private->editingDelegate;
 }
 
+- (DOMDocument *)DOMDocument
+{
+    if ([[[[self mainFrame] dataSource] representation] conformsToProtocol:@protocol(WebDocumentDOM)]) {
+        return [(id <WebDocumentDOM>)[[[self mainFrame] dataSource] representation] DOMDocument];
+    }
+    return nil;
+}
+
+- (DOMCSSStyleDeclaration *)styleDeclarationWithText:(NSString *)text
+{
+    DOMCSSStyleDeclaration *decl = [[self DOMDocument] createCSSStyleDeclaration];
+    [decl setCssText:text];
+    return decl;
+}
+
 @end
 
 @implementation WebView (WebViewUndoableEditing)
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 127ec14..45b0551 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -338,6 +338,8 @@ typedef enum {
 - (NSUndoManager *)undoManager;
 - (void)setEditingDelegate:(id)delegate;
 - (id)editingDelegate;
+- (DOMDocument *)DOMDocument;
+- (DOMCSSStyleDeclaration *)styleDeclarationWithText:(NSString *)text;
 @end
 
 @interface WebView (WebViewUndoableEditing)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list