[webkit-changes] cvs commit: WebCore/kwq DOM.mm DOMPrivate.h
David
hyatt at opensource.apple.com
Thu Nov 17 14:29:14 PST 2005
hyatt 05/11/17 14:29:14
Modified: . ChangeLog
khtml/xml dom_elementimpl.h
kwq DOM.mm DOMPrivate.h
Log:
Add support for getting a style property off of a DOMAttr. This is an API that allows
access to the style declaration for HTML presentational attributes like width and height. This API exists only
in Objective-C, since JS would have to make the declaration readonly before it could be safely
returned.
Reviewed by darin
* khtml/xml/dom_elementimpl.h:
(DOM::AttributeImpl::style):
(DOM::AttrImpl::style):
(DOM::MappedAttributeImpl::style):
* kwq/DOM.mm:
(-[DOMAttr style]):
* kwq/DOMPrivate.h:
Revision Changes Path
1.378 +17 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.377
retrieving revision 1.378
diff -u -r1.377 -r1.378
--- ChangeLog 17 Nov 2005 21:28:07 -0000 1.377
+++ ChangeLog 17 Nov 2005 22:29:09 -0000 1.378
@@ -1,5 +1,22 @@
2005-11-17 David Hyatt <hyatt at apple.com>
+ Add support for getting a style property off of a DOMAttr. This is an API that allows
+ access to the style declaration for HTML presentational attributes like width and height. This API exists only
+ in Objective-C, since JS would have to make the declaration readonly before it could be safely
+ returned.
+
+ Reviewed by darin
+
+ * khtml/xml/dom_elementimpl.h:
+ (DOM::AttributeImpl::style):
+ (DOM::AttrImpl::style):
+ (DOM::MappedAttributeImpl::style):
+ * kwq/DOM.mm:
+ (-[DOMAttr style]):
+ * kwq/DOMPrivate.h:
+
+2005-11-17 David Hyatt <hyatt at apple.com>
+
Add support for getMatchedCSSRules, an API that can be used to
inspect the set of rules that match on an element. From Obj-C
you see all rules (user agent, author, user). From JS you just
1.61 +8 -0 WebCore/khtml/xml/dom_elementimpl.h
Index: dom_elementimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- dom_elementimpl.h 15 Nov 2005 02:05:43 -0000 1.60
+++ dom_elementimpl.h 17 Nov 2005 22:29:13 -0000 1.61
@@ -90,6 +90,9 @@
virtual AttributeImpl* clone(bool preserveDecl=true) const;
+ // An extension to get the style information for presentational attributes.
+ virtual CSSStyleDeclarationImpl* style() const { return 0; }
+
private:
void setValue(const AtomicString& value) { m_value = value; }
void setPrefix(const AtomicString& prefix) { m_name.setPrefix(prefix); }
@@ -150,6 +153,9 @@
virtual void childrenChanged();
virtual DOMString toString() const;
+ // An extension to get presentational information for attributes.
+ CSSStyleDeclarationImpl* style() { return m_attribute->style(); }
+
protected:
ElementImpl* m_element;
AttributeImpl* m_attribute;
@@ -383,6 +389,8 @@
virtual AttributeImpl* clone(bool preserveDecl=true) const;
+ virtual CSSStyleDeclarationImpl* style() const { return m_styleDecl; }
+
CSSMappedAttributeDeclarationImpl* decl() const { return m_styleDecl; }
void setDecl(CSSMappedAttributeDeclarationImpl* decl)
{
1.58 +5 -0 WebCore/kwq/DOM.mm
Index: DOM.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/DOM.mm,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- DOM.mm 16 Nov 2005 09:43:14 -0000 1.57
+++ DOM.mm 17 Nov 2005 22:29:13 -0000 1.58
@@ -1277,6 +1277,11 @@
return [DOMElement _elementWithImpl:[self _attrImpl]->ownerElement()];
}
+- (DOMCSSStyleDeclaration *)style
+{
+ return [DOMCSSStyleDeclaration _styleDeclarationWithImpl: [self _attrImpl]->style()];
+}
+
@end
@implementation DOMAttr (WebCoreInternal)
1.9 +10 -0 WebCore/kwq/DOMPrivate.h
Index: DOMPrivate.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/DOMPrivate.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DOMPrivate.h 1 Aug 2005 16:12:03 -0000 1.8
+++ DOMPrivate.h 17 Nov 2005 22:29:14 -0000 1.9
@@ -75,3 +75,13 @@
- (NSArray *)_optionLabels;
@end
+// BEGIN PENDING PUBLIC WEB INSPECTOR APIS
+// These APIs are for the Web Inspector, and they will be made public eventually.
+ at interface DOMAttr (DOMAttrExtensions)
+- (DOMCSSStyleDeclaration *)style;
+ at end
+
+ at interface DOMDocument (DOMViewCSSExtensions)
+- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt;
+ at end
+// END
More information about the webkit-changes
mailing list