Changeset 21184
- Timestamp:
- 04/29/07 13:32:51 (3 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 18 modified
-
ChangeLog (modified) (1 diff)
-
dom/Attr.cpp (modified) (2 diffs)
-
dom/Attr.h (modified) (4 diffs)
-
dom/Attribute.cpp (modified) (3 diffs)
-
dom/Document.cpp (modified) (1 diff)
-
dom/Element.cpp (modified) (5 diffs)
-
dom/Element.h (modified) (11 diffs)
-
dom/NamedAttrMap.cpp (modified) (3 diffs)
-
dom/NamedAttrMap.h (modified) (3 diffs)
-
dom/NamedMappedAttrMap.cpp (modified) (2 diffs)
-
dom/Node.cpp (modified) (4 diffs)
-
dom/Node.h (modified) (2 diffs)
-
dom/StyledElement.h (modified) (3 diffs)
-
html/HTMLElement.cpp (modified) (3 diffs)
-
html/HTMLTokenizer.h (modified) (2 diffs)
-
rendering/RenderLayer.cpp (modified) (3 diffs)
-
xml/XPathFunctions.cpp (modified) (1 diff)
-
xml/XPathStep.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r21183 r21184 1 2007-04-29 Darin Adler <darin@apple.com> 2 3 Reviewed by Adele. 4 5 - fix the Gmail part of http://bugs.webkit.org/show_bug.cgi?id=12798 6 and <rdar://problem/4118559> 7 8 This patch changes things so that resizing can make things larger than their 9 initial size, but not smaller. I believe this resolves the problem for Gmail, 10 but you can still get strange behavior if you have a small right-aligned <textarea>. 11 12 * rendering/RenderLayer.cpp: 13 (WebCore::RenderLayer::resize): Rewrote to use more IntPoint and IntSize and add 14 in a new minimum-size algorithm. This function now has the side effect of storing 15 a new minimumSizeForResizing in the element being resized, and respects any existing 16 minimum as well. 17 (WebCore::RenderLayer::offsetFromResizeCorner): Reversed this so it converts the 18 point into coordinates relative to the resize corner, hence negative numbers mean 19 the point is above and to the left. This is used only in the algorithm above. 20 21 * dom/Element.h: Removed unneeded include of Attr.h, and added forward declarations 22 as needed. Removed all friend declarations; there was no need for any of them. 23 Tweaked formatting of various declarations and removed unneeded parameter names. 24 Made as much as possible private, and a couple things public to avoid the need for 25 friend classes. Added minimumSizeForResizing, setMinimumSizeForResizing, rareData, 26 and createRareData functions. 27 28 * dom/Element.cpp: 29 (WebCore::rareDataMap): Added. Function to return the single global map. 30 (WebCore::rareDataFromMap): Added. For use by inlined functions to get the 31 data from the map in the case where it's present. 32 (WebCore::ElementRareData::ElementRareData): Added. 33 (WebCore::Element::~Element): Added code to delete the element from the rare 34 data map when appropriate. 35 (WebCore::Element::rareData): Added. 36 (WebCore::Element::createRareData): Added. 37 (WebCore::Element::setAttributeNodeNS): Got rid of the old inline version of this, 38 since it was the sole reason we had to include Attr.h in Element.h. 39 (WebCore::Element::minimumSizeForResizing): Added. Accesses rare data. 40 (WebCore::Element::setMinimumSizeForResizing): Ditto. 41 42 * dom/Node.h: Renamed the m_specified bit since it's now used for two purposes. 43 Its new long name is m_attrWasSpecifiedOrElementHasRareData. 44 45 * dom/Attr.cpp: (WebCore::Attr::Attr): Updated for bit name change. 46 * dom/Attr.h: 47 (WebCore::Attr::specified): Ditto. 48 (WebCore::Attr::setSpecified): Added, since setting the bit directly is pretty ugly now. 49 * dom/Document.cpp: (WebCore::Document::adoptNode): Updated for bit name change. 50 * dom/Node.cpp: 51 (WebCore::Node::Node): Ditto. 52 (WebCore::Node::dump): Ditto. 53 54 * dom/NamedAttrMap.cpp: (WebCore::NamedAttrMap::isReadOnlyNode): Moved out of line, 55 since this was the sole reason we had to include Element.h in NamedAttrMap.h. 56 57 * html/HTMLElement.cpp: 58 (WebCore::HTMLElement::nodeName): Changed to use tagQName() since that's a public 59 way to do something that's now private. 60 (WebCore::HTMLElement::cloneNode): Ditto. 61 62 * dom/Attribute.cpp: 63 * dom/NamedAttrMap.h: 64 * dom/NamedMappedAttrMap.cpp: 65 * dom/StyledElement.h: 66 * html/HTMLTokenizer.h: 67 * xml/XPathFunctions.cpp: 68 * xml/XPathStep.cpp: 69 Updated includes, and other administrivia. 70 1 71 2007-04-29 Mitz Pettel <mitz@webkit.org> 2 72 -
trunk/WebCore/dom/Attr.cpp
r20495 r21184 1 /** 2 * This file is part of the DOM implementation for KDE. 3 * 1 /* 4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 41 39 ASSERT(!m_attribute->attr()); 42 40 m_attribute->m_impl = this; 43 m_ specified= true;41 m_attrWasSpecifiedOrElementHasRareData = true; 44 42 } 45 43 -
trunk/WebCore/dom/Attr.h
r13480 r21184 1 1 /* 2 * This file is part of the DOM implementation for KDE.3 *4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 33 31 namespace WebCore { 34 32 35 36 33 // this has no counterpart in DOM, purely internal 37 34 // representation of the nodevalue of an Attr. … … 59 56 // DOM methods & attributes for Attr 60 57 String name() const { return qualifiedName().toString(); } 61 bool specified() const { return m_ specified; }58 bool specified() const { return m_attrWasSpecifiedOrElementHasRareData; } 62 59 Element* ownerElement() const { return m_element; } 63 60 … … 90 87 CSSStyleDeclaration* style() { return m_attribute->style(); } 91 88 89 void setSpecified(bool specified) { m_attrWasSpecifiedOrElementHasRareData = specified; } 90 92 91 private: 93 92 Element* m_element; -
trunk/WebCore/dom/Attribute.cpp
r13821 r21184 1 /** 2 * This file is part of the DOM implementation for KDE. 3 * 1 /* 4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 27 25 #include "Attribute.h" 28 26 27 #include "Attr.h" 29 28 #include "Element.h" 30 29 … … 38 37 PassRefPtr<Attr> Attribute::createAttrIfNeeded(Element* e) 39 38 { 40 RefPtr<Attr> r (m_impl);39 RefPtr<Attr> r = m_impl; 41 40 if (!r) { 42 41 r = new Attr(e, e->document(), this); -
trunk/WebCore/dom/Document.cpp
r21179 r21184 637 637 if (attr->ownerElement()) 638 638 attr->ownerElement()->removeAttributeNode(attr, ec); 639 attr->m_ specified= true;639 attr->m_attrWasSpecifiedOrElementHasRareData = true; 640 640 break; 641 641 } -
trunk/WebCore/dom/Element.cpp
r20950 r21184 1 /** 2 * This file is part of the DOM implementation for KDE. 3 * 1 /* 4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 50 48 using namespace XMLNames; 51 49 50 class ElementRareData { 51 public: 52 ElementRareData(Element*); 53 IntSize m_minimumSizeForResizing; 54 }; 55 56 typedef HashMap<const Element*, ElementRareData*> ElementRareDataMap; 57 58 static ElementRareDataMap& rareDataMap() 59 { 60 static ElementRareDataMap* dataMap = new ElementRareDataMap; 61 return *dataMap; 62 } 63 64 static ElementRareData* rareDataFromMap(const Element* element) 65 { 66 return rareDataMap().get(element); 67 } 68 69 static inline IntSize defaultMinimumSizeForResizing() 70 { 71 return IntSize(INT_MAX, INT_MAX); 72 } 73 74 inline ElementRareData::ElementRareData(Element* element) 75 : m_minimumSizeForResizing(defaultMinimumSizeForResizing()) 76 { 77 } 78 52 79 Element::Element(const QualifiedName& qName, Document *doc) 53 80 : ContainerNode(doc) … … 62 89 if (namedAttrMap) 63 90 namedAttrMap->detachFromElement(); 91 92 if (!m_attrWasSpecifiedOrElementHasRareData) 93 ASSERT(!rareDataMap().contains(this)); 94 else { 95 ElementRareDataMap& dataMap = rareDataMap(); 96 ElementRareDataMap::iterator it = dataMap.find(this); 97 ASSERT(it != dataMap.end()); 98 delete it->second; 99 dataMap.remove(it); 100 } 101 } 102 103 inline ElementRareData* Element::rareData() 104 { 105 return m_attrWasSpecifiedOrElementHasRareData ? rareDataFromMap(this) : 0; 106 } 107 108 inline const ElementRareData* Element::rareData() const 109 { 110 return m_attrWasSpecifiedOrElementHasRareData ? rareDataFromMap(this) : 0; 111 } 112 113 ElementRareData* Element::createRareData() 114 { 115 if (m_attrWasSpecifiedOrElementHasRareData) 116 return rareDataMap().get(this); 117 ASSERT(!rareDataMap().contains(this)); 118 ElementRareData* data = new ElementRareData(this); 119 rareDataMap().set(this, data); 120 m_attrWasSpecifiedOrElementHasRareData = true; 121 return data; 64 122 } 65 123 … … 816 874 } 817 875 876 PassRefPtr<Attr> Element::setAttributeNodeNS(Attr* attr, ExceptionCode& ec) 877 { 878 ASSERT(attr); 879 return static_pointer_cast<Attr>(attributes(false)->setNamedItem(attr, ec)); 880 } 881 818 882 PassRefPtr<Attr> Element::removeAttributeNode(Attr *attr, ExceptionCode& ec) 819 883 { … … 986 1050 } 987 1051 988 } 1052 IntSize Element::minimumSizeForResizing() const 1053 { 1054 const ElementRareData* rd = rareData(); 1055 return rd ? rd->m_minimumSizeForResizing : defaultMinimumSizeForResizing(); 1056 } 1057 1058 void Element::setMinimumSizeForResizing(const IntSize& size) 1059 { 1060 if (size == defaultMinimumSizeForResizing() && !rareData()) 1061 return; 1062 createRareData()->m_minimumSizeForResizing = size; 1063 } 1064 1065 } -
trunk/WebCore/dom/Element.h
r20072 r21184 1 1 /* 2 * This file is part of the DOM implementation for KDE.3 *4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 28 26 #define Element_h 29 27 30 #include "Attr.h" 28 #include "ContainerNode.h" 29 #include "QualifiedName.h" 31 30 #include "ScrollTypes.h" 32 31 #include "Timer.h" … … 35 34 36 35 class AtomicStringList; 36 class Attr; 37 37 class Attribute; 38 class CSSStyleDeclaration; 39 class ElementRareData; 40 class IntSize; 38 41 39 42 class Element : public ContainerNode { 40 friend class Document;41 friend class NamedAttrMap;42 friend class Attr;43 friend class Node;44 friend class CSSStyleSelector;45 43 public: 46 44 Element(const QualifiedName&, Document*); … … 50 48 virtual const AtomicStringList* getClassList() const; 51 49 const AtomicString& getIDAttribute() const; 52 bool hasAttribute(const QualifiedName& name) const;53 const AtomicString& getAttribute(const QualifiedName& name) const;54 void setAttribute(const QualifiedName& name, StringImpl* value, ExceptionCode&);55 void removeAttribute(const QualifiedName& name, ExceptionCode&);50 bool hasAttribute(const QualifiedName&) const; 51 const AtomicString& getAttribute(const QualifiedName&) const; 52 void setAttribute(const QualifiedName&, StringImpl* value, ExceptionCode&); 53 void removeAttribute(const QualifiedName&, ExceptionCode&); 56 54 57 55 bool hasAttributes() const; … … 89 87 int scrollHeight(); 90 88 91 void removeAttribute(const String &name, ExceptionCode& ec);92 void removeAttributeNS(const String &namespaceURI, const String& localName, ExceptionCode&);89 void removeAttribute(const String& name, ExceptionCode&); 90 void removeAttributeNS(const String& namespaceURI, const String& localName, ExceptionCode&); 93 91 94 92 PassRefPtr<Attr> getAttributeNode(const String& name); 95 93 PassRefPtr<Attr> getAttributeNodeNS(const String& namespaceURI, const String& localName); 96 94 PassRefPtr<Attr> setAttributeNode(Attr*, ExceptionCode&); 97 PassRefPtr<Attr> setAttributeNodeNS(Attr* newAttr, ExceptionCode& ec) { return setAttributeNode(newAttr, ec); }95 PassRefPtr<Attr> setAttributeNodeNS(Attr*, ExceptionCode&); 98 96 PassRefPtr<Attr> removeAttributeNode(Attr*, ExceptionCode&); 99 97 100 virtual CSSStyleDeclaration *style();98 virtual CSSStyleDeclaration* style(); 101 99 102 100 const QualifiedName& tagQName() const { return m_tagName; } … … 126 124 127 125 // convenience methods which ignore exceptions 128 void setAttribute(const QualifiedName& name, const String& value);129 130 virtual NamedAttrMap *attributes() const;126 void setAttribute(const QualifiedName&, const String& value); 127 128 virtual NamedAttrMap* attributes() const; 131 129 NamedAttrMap* attributes(bool readonly) const; 132 130 133 131 // This method is called whenever an attribute is added, changed or removed. 134 virtual void attributeChanged(Attribute* attr, bool preserveDecls = false) {}132 virtual void attributeChanged(Attribute*, bool preserveDecls = false) {} 135 133 136 134 // not part of the DOM 137 135 void setAttributeMap(NamedAttrMap*); 138 136 139 virtual void copyNonAttributeProperties(const Element *source) {}137 virtual void copyNonAttributeProperties(const Element* source) {} 140 138 141 139 virtual void attach(); 142 140 virtual void detach(); 143 virtual RenderStyle *styleForRenderer(RenderObject *parent);144 virtual RenderObject *createRenderer(RenderArena *, RenderStyle*);145 virtual void recalcStyle( StyleChange = NoChange);141 virtual RenderStyle* styleForRenderer(RenderObject* parent); 142 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 143 virtual void recalcStyle(StyleChange = NoChange); 146 144 147 145 virtual bool childTypeAllowed(NodeType); … … 149 147 virtual Attribute* createAttribute(const QualifiedName& name, StringImpl* value); 150 148 151 void dispatchAttrRemovalEvent(Attribute *attr);152 void dispatchAttrAdditionEvent(Attribute *attr);149 void dispatchAttrRemovalEvent(Attribute*); 150 void dispatchAttrAdditionEvent(Attribute*); 153 151 154 152 virtual void accessKeyAction(bool sendToAnyEvent) { } … … 156 154 virtual String toString() const; 157 155 158 virtual bool isURLAttribute(Attribute *attr) const;156 virtual bool isURLAttribute(Attribute*) const; 159 157 virtual String target() const { return String(); } 160 158 … … 164 162 bool needsFocusAppearanceUpdate() const { return m_needsFocusAppearanceUpdate; } 165 163 void setNeedsFocusAppearanceUpdate(bool b) { m_needsFocusAppearanceUpdate = b; } 166 164 167 165 #ifndef NDEBUG 168 virtual void dump(TextStream *stream, DeprecatedString ind = "") const;169 virtual void formatForDebugger(char *buffer, unsigned length) const;166 virtual void dump(TextStream* , DeprecatedString ind = "") const; 167 virtual void formatForDebugger(char* buffer, unsigned length) const; 170 168 #endif 171 169 172 Node* insertAdjacentElement(const String& where, Node* newChild, int& exception);170 Node* insertAdjacentElement(const String& where, Node* newChild, ExceptionCode&); 173 171 bool contains(const Node*) const; 174 172 … … 178 176 virtual String title() const; 179 177 180 protected: 178 String openTagStartToString() const; 179 180 void updateId(const AtomicString& oldId, const AtomicString& newId); 181 182 IntSize minimumSizeForResizing() const; 183 void setMinimumSizeForResizing(const IntSize&); 184 185 private: 186 ElementRareData* rareData(); 187 const ElementRareData* rareData() const; 188 ElementRareData* createRareData(); 189 181 190 virtual void createAttributeMap() const; 182 String openTagStartToString() const;183 184 private:185 void updateId(const AtomicString& oldId, const AtomicString& newId);186 191 187 192 virtual void updateStyleAttributeIfNeeded() const {} … … 192 197 bool m_needsFocusAppearanceUpdate; 193 198 194 protected: // member variables199 protected: 195 200 mutable RefPtr<NamedAttrMap> namedAttrMap; 201 202 private: 196 203 QualifiedName m_tagName; 197 204 }; -
trunk/WebCore/dom/NamedAttrMap.cpp
r18428 r21184 1 /** 2 * This file is part of the DOM implementation for KDE. 3 * 1 /* 4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 23 21 * Boston, MA 02111-1307, USA. 24 22 */ 23 25 24 #include "config.h" 26 25 #include "NamedAttrMap.h" 27 26 28 27 #include "Document.h" 28 #include "Element.h" 29 29 #include "ExceptionCode.h" 30 30 #include "HTMLNames.h" … … 359 359 } 360 360 361 } 361 bool NamedAttrMap::isReadOnlyNode() 362 { 363 return element && element->isReadOnlyNode(); 364 } 365 366 } -
trunk/WebCore/dom/NamedAttrMap.h
r20495 r21184 28 28 #define NamedAttrMap_h 29 29 30 #include " Element.h"30 #include "Attribute.h" 31 31 #include "NamedNodeMap.h" 32 32 … … 41 41 friend class Element; 42 42 public: 43 NamedAttrMap(Element *e);43 NamedAttrMap(Element*); 44 44 virtual ~NamedAttrMap(); 45 45 NamedAttrMap(const NamedAttrMap&); … … 65 65 Attribute* getAttributeItem(const QualifiedName& name) const; 66 66 Attribute* getAttributeItem(const String& name) const; 67 virtual bool isReadOnlyNode() { return element ? element->isReadOnlyNode() : false; }67 virtual bool isReadOnlyNode(); 68 68 69 69 // used during parsing: only inserts if not already there -
trunk/WebCore/dom/NamedMappedAttrMap.cpp
r14273 r21184 1 /** 2 * This file is part of the DOM implementation for KDE. 3 * 1 /* 4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 23 21 * Boston, MA 02111-1307, USA. 24 22 */ 23 25 24 #include "config.h" 26 25 #include "NamedMappedAttrMap.h" 27 26 28 27 #include "Document.h" 28 #include "Element.h" 29 29 30 30 namespace WebCore { -
trunk/WebCore/dom/Node.cpp
r21169 r21184 1 /** 2 * This file is part of the DOM implementation for KDE. 3 * 1 /* 4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 7 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 8 6 * Copyright (C) 2007 Trolltech ASA 9 7 * … … 31 29 #include "DOMImplementation.h" 32 30 #include "Document.h" 31 #include "Element.h" 33 32 #include "ExceptionCode.h" 34 33 #include "Frame.h" … … 150 149 m_inDocument(false), 151 150 m_isLink(false), 152 m_ specified(false),151 m_attrWasSpecifiedOrElementHasRareData(false), 153 152 m_focused(false), 154 153 m_active(false), … … 798 797 if (m_hasClass) { *stream << " hasClass"; } 799 798 if (m_hasStyle) { *stream << " hasStyle"; } 800 if (m_specified) { *stream << " specified"; }801 799 if (m_focused) { *stream << " focused"; } 802 800 if (m_active) { *stream << " active"; } -
trunk/WebCore/dom/Node.h
r21003 r21184 1 1 /* 2 * This file is part of the DOM implementation for KDE.3 *4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 7 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 8 6 * 9 7 * This library is free software; you can redistribute it and/or … … 472 470 473 471 bool m_isLink : 1; 474 bool m_ specified : 1; // used in Attr; accessor functions there472 bool m_attrWasSpecifiedOrElementHasRareData : 1; // used in Attr for one thing and Element for another 475 473 bool m_focused : 1; 476 474 bool m_active : 1; -
trunk/WebCore/dom/StyledElement.h
r18386 r21184 1 1 /* 2 * This file is part of the DOM implementation for KDE.3 *4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 28 26 #define StyledElement_h 29 27 28 #include "Element.h" 30 29 #include "NamedMappedAttrMap.h" 31 30 … … 35 34 class MappedAttribute; 36 35 37 class StyledElement : public Element 38 { 36 class StyledElement : public Element { 39 37 public: 40 38 StyledElement(const QualifiedName&, Document*); -
trunk/WebCore/html/HTMLElement.cpp
r20495 r21184 1 /** 2 * This file is part of the DOM implementation for KDE. 3 * 1 /* 4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) … … 66 64 // the string on a hit in the hash. 67 65 if (document()->isHTMLDocument()) 68 return m_tagName.localName().impl()->upper();66 return tagQName().localName().impl()->upper(); 69 67 return Element::nodeName(); 70 68 } … … 94 92 PassRefPtr<Node> HTMLElement::cloneNode(bool deep) 95 93 { 96 RefPtr<HTMLElement> clone = HTMLElementFactory::createHTMLElement( m_tagName.localName(), document(), 0, false);94 RefPtr<HTMLElement> clone = HTMLElementFactory::createHTMLElement(tagQName().localName(), document(), 0, false); 97 95 if (!clone) 98 96 return 0; -
trunk/WebCore/html/HTMLTokenizer.h
r18848 r21184 1 1 /* 2 This file is part of the KDE libraries3 4 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) 5 3 (C) 1997 Torben Weis (weis@kde.org) … … 115 113 State parseProcessingInstruction(SegmentedString&, State); 116 114 State scriptHandler(State); 117 State scriptExecution(const DeprecatedString& script, State state, DeprecatedString scriptURL = DeprecatedString(), int baseLine = 0);115 State scriptExecution(const DeprecatedString& script, State, DeprecatedString scriptURL, int baseLine = 0); 118 116 void setSrc(const SegmentedString&); 119 117 -
trunk/WebCore/rendering/RenderLayer.cpp
r21183 r21184 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * 4 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. … … 865 865 } 866 866 867 void RenderLayer::resize(const PlatformMouseEvent& evt, const IntSize& offsetFromResizeCorner) 868 { 869 if (!inResizeMode() || !renderer()->hasOverflowClip() || m_object->style()->resize() == RESIZE_NONE) 870 return; 871 872 if (!m_object->document()->frame()->eventHandler()->mousePressed()) 873 return; 874 875 // FIXME Radar 4118559: This behaves very oddly for textareas that are in blocks with right-aligned text; you have 876 // to drag the bottom-right corner to make the bottom-left corner move. 877 // FIXME Radar 4118564: ideally we'd autoscroll the window as necessary to keep the point under 878 // the cursor in view. 879 880 IntPoint currentPoint = m_object->document()->view()->windowToContents(evt.pos()); 881 currentPoint += offsetFromResizeCorner; 882 883 int x; 884 int y; 885 m_object->absolutePosition(x, y); 886 int right = x + m_object->width(); 887 int bottom = y + m_object->height(); 888 int diffWidth = max(currentPoint.x() - right, min(0, MinimumWidthWhileResizing - m_object->width())); 889 int diffHeight = max(currentPoint.y() - bottom, min(0, MinimumHeightWhileResizing - m_object->height())); 890 891 ExceptionCode ec = 0; 892 // Set the width and height for the shadow ancestor node. This is necessary for textareas since the resizable layer is on the inner div. 893 // For non-shadow content, this will set the width and height on the original node. 894 RenderObject* renderer = m_object->node()->shadowAncestorNode()->renderer(); 895 if (diffWidth && (m_object->style()->resize() == RESIZE_HORIZONTAL || m_object->style()->resize() == RESIZE_BOTH)) { 896 CSSStyleDeclaration* style = static_cast<Element*>(m_object->node()->shadowAncestorNode())->style(); 897 if (renderer->element() && renderer->element()->isControl()) { 867 void RenderLayer::resize(const PlatformMouseEvent& evt, const IntSize& oldOffset) 868 { 869 if (!inResizeMode() || !m_object->hasOverflowClip()) 870 return; 871 872 // Set the width and height of the shadow ancestor node if there is one. 873 // This is necessary for textarea elements since the resizable layer is in the shadow content. 874 Element* element = static_cast<Element*>(m_object->node()->shadowAncestorNode()); 875 RenderBox* renderer = static_cast<RenderBox*>(element->renderer()); 876 877 EResize resize = renderer->style()->resize(); 878 if (resize == RESIZE_NONE) 879 return; 880 881 Document* document = element->document(); 882 if (!document->frame()->eventHandler()->mousePressed()) 883 return; 884 885 IntSize newOffset = offsetFromResizeCorner(document->view()->windowToContents(evt.pos())); 886 887 IntSize currentSize = IntSize(renderer->width(), renderer->height()); 888 889 IntSize minimumSize = element->minimumSizeForResizing().shrunkTo(currentSize); 890 element->setMinimumSizeForResizing(minimumSize); 891 892 IntSize difference = (currentSize + newOffset - oldOffset).expandedTo(minimumSize) - currentSize; 893 894 CSSStyleDeclaration* style = element->style(); 895 bool isBoxSizingBorder = renderer->style()->boxSizing() == BORDER_BOX; 896 897 ExceptionCode ec; 898 899 if (difference.width()) { 900 if (element && element->isControl()) { 901 // Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>). 898 902 style->setProperty(CSS_PROP_MARGIN_LEFT, String::number(renderer->marginLeft()) + "px", false, ec); 899 903 style->setProperty(CSS_PROP_MARGIN_RIGHT, String::number(renderer->marginRight()) + "px", false, ec); 900 904 } 901 int baseWidth = renderer->width() - (renderer->style()->boxSizing() == BORDER_BOX ? 0 : renderer->borderLeft() + renderer->paddingLeft() + renderer->borderRight() + renderer->paddingRight()); 902 style->setProperty(CSS_PROP_WIDTH, String::number(baseWidth + diffWidth) + "px", false, ec); 903 } 904 905 if (diffHeight && (m_object->style()->resize() == RESIZE_VERTICAL || m_object->style()->resize() == RESIZE_BOTH)) { 906 CSSStyleDeclaration* style = static_cast<Element*>(m_object->node()->shadowAncestorNode())->style(); 907 if (renderer->element() && renderer->element()->isControl()) { 905 int baseWidth = renderer->width() - (isBoxSizingBorder ? 0 906 : renderer->borderLeft() + renderer->paddingLeft() + renderer->borderRight() + renderer->paddingRight()); 907 style->setProperty(CSS_PROP_WIDTH, String::number(baseWidth + difference.width()) + "px", false, ec); 908 } 909 910 if (difference.height()) { 911 if (element && element->isControl()) { 912 // Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>). 908 913 style->setProperty(CSS_PROP_MARGIN_TOP, String::number(renderer->marginTop()) + "px", false, ec); 909 914 style->setProperty(CSS_PROP_MARGIN_BOTTOM, String::number(renderer->marginBottom()) + "px", false, ec); 910 915 } 911 int baseHeight = renderer->height() - (renderer->style()->boxSizing() == BORDER_BOX ? 0 : renderer->borderTop() + renderer->paddingTop() + renderer->borderBottom() + renderer->paddingBottom()); 912 style->setProperty(CSS_PROP_HEIGHT, String::number(baseHeight + diffHeight) + "px", false, ec); 913 } 914 915 ASSERT(ec == 0); 916 917 if (m_object->style()->resize() != RESIZE_NONE) { 918 m_object->setNeedsLayout(true); 919 m_object->node()->shadowAncestorNode()->renderer()->setNeedsLayout(true); 920 m_object->document()->updateLayout(); 921 } 916 int baseHeight = renderer->height() - (isBoxSizingBorder ? 0 917 : renderer->borderTop() + renderer->paddingTop() + renderer->borderBottom() + renderer->paddingBottom()); 918 style->setProperty(CSS_PROP_HEIGHT, String::number(baseHeight + difference.height()) + "px", false, ec); 919 } 920 921 document->updateLayout(); 922 923 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view. 922 924 } 923 925 … … 1044 1046 int y = height(); 1045 1047 convertToLayerCoords(root(), x, y); 1046 return IntSize(x - p.x(), y - p.y());1048 return p - IntPoint(x, y); 1047 1049 } 1048 1050 -
trunk/WebCore/xml/XPathFunctions.cpp
r20620 r21184 32 32 33 33 #include "Document.h" 34 #include "Element.h" 34 35 #include "NamedAttrMap.h" 35 36 #include "XMLNames.h" -
trunk/WebCore/xml/XPathStep.cpp
r20620 r21184 32 32 33 33 #include "Document.h" 34 #include "Element.h" 34 35 #include "NamedAttrMap.h" 35 36 #include "XPathNSResolver.h"