Changeset 16703 in webkit
- Timestamp:
- Oct 1, 2006 6:02:49 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r16700 r16703 1 2006-09-30 Geoffrey Garen <ggaren@apple.com> 2 3 Added test for the viewource attribute, which applies to <frame> and 4 <iframe> elements. 5 6 * fast/frames/viewsource-attribute-expected.txt: Added. 7 * fast/frames/viewsource-attribute.html: Added. 8 9 * fast/frames/frameElement-widthheight.html: Removed stray character. 10 1 11 2006-09-30 David Harrison <harrison@apple.com> 2 12 -
trunk/LayoutTests/fast/frames/frameElement-widthheight.html
r11995 r16703 26 26 27 27 ref = top.frame2.frameElement; 28 top.frameset.removeChild(top.frame2.frameElement); 28 top.frameset.removeChild(top.frame2.frameElement); 29 29 if (ref.width != 0 || ref.height != 0) { 30 30 log('Incorrect deleted frame size: ' + ref.width + 'x' + ref.height); -
trunk/WebCore/ChangeLog
r16701 r16703 1 2006-10-01 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Maciej. 4 5 More frame/iframe merging. 6 7 - Removed needWidgetUpdate and related code. needWidgetUpdate is always 8 false, so this was dead code. 9 - Removed FIXME about setInViewSourceMode inside openURL(). openURL(), rather 10 than attach(), is the correct place for setInViewSourceMode, because 11 openURL() is the function that creates our frame. 12 - Moved IFRAME insertedIntoDocument() code into FRAME, and removed FRAME 13 code that did the same thing in other places. 14 - Made FRAME's attach() method suffuciently generic so that IFRAME could 15 call up to it, rather than skipping its superclass and calling up directly 16 to ELEMENT. 17 - Changed a few IFRAME up-calls to ELEMENT into up-calls to FRAME. 18 - Replaced ad hoc frame loading code in FRAME::attach() with call to 19 openURL(), the designated frame loading function. 20 21 Layout tests pass. I added a layout test for viewsource mode, since I 22 broke it in the course of writing this patch. 23 1 24 2006-10-01 Anders Carlsson <acarlsson@apple.com> 2 25 -
trunk/WebCore/html/HTMLFrameElement.cpp
r16661 r16703 118 118 document()->frame()->requestFrame(this, m_URL, m_name); 119 119 120 // FIXME: This is a relic from how HTMLIFrameElement used to do things.121 // It's probably unnecessary, since viewsource mode doesn't really work,122 // and both parseMappedAttribute and attach include the same check.123 120 if (contentFrame()) 124 121 contentFrame()->setInViewSourceMode(viewSourceMode()); … … 184 181 } 185 182 186 void HTMLFrameElement::attach() 187 { 183 void HTMLFrameElement::insertedIntoDocument() 184 { 185 HTMLElement::insertedIntoDocument(); 186 188 187 m_name = getAttribute(nameAttr); 189 188 if (m_name.isNull()) 190 189 m_name = getAttribute(idAttr); 191 190 192 // inherit default settings from parent frameset 193 for (Node *node = parentNode(); node; node = node->parentNode()) 194 if (node->hasTagName(framesetTag)) { 195 HTMLFrameSetElement* frameset = static_cast<HTMLFrameSetElement*>(node); 191 if (Frame* parentFrame = document()->frame()) 192 m_name = parentFrame->tree()->uniqueChildName(m_name); 193 } 194 195 void HTMLFrameElement::attach() 196 { 197 HTMLElement::attach(); 198 199 if (hasTagName(frameTag)) { 200 if (HTMLFrameSetElement* frameSetElement = containingFrameSetElement()) { 196 201 if (!m_frameBorderSet) 197 m_frameBorder = frame set->frameBorder();202 m_frameBorder = frameSetElement->frameBorder(); 198 203 if (!m_noResize) 199 m_noResize = frameset->noResize(); 200 break; 204 m_noResize = frameSetElement->noResize(); 201 205 } 202 203 HTMLElement::attach(); 204 205 if (!renderer()) 206 return; 207 208 Frame* frame = document()->frame(); 209 210 if (!frame) 211 return; 212 213 AtomicString relativeURL = m_URL; 214 if (relativeURL.isEmpty()) 215 relativeURL = "about:blank"; 216 217 m_name = frame->tree()->uniqueChildName(m_name); 218 219 // load the frame contents 220 frame->requestFrame(this, relativeURL, m_name); 221 222 if (contentFrame()) 223 contentFrame()->setInViewSourceMode(viewSourceMode()); 206 } 207 208 if (!contentFrame()) 209 openURL(); 224 210 } 225 211 … … 308 294 } 309 295 296 HTMLFrameSetElement* HTMLFrameElement::containingFrameSetElement() const 297 { 298 for (Node* node = parentNode(); node; node = node->parentNode()) 299 if (node->hasTagName(framesetTag)) 300 return static_cast<HTMLFrameSetElement*>(node); 301 302 return 0; 303 } 304 310 305 bool HTMLFrameElement::isURLAttribute(Attribute *attr) const 311 306 { -
trunk/WebCore/html/HTMLFrameElement.h
r15050 r16703 33 33 34 34 class Frame; 35 class HTMLFrameSetElement; 35 36 36 37 class HTMLFrameElement : public HTMLElement … … 50 51 51 52 virtual void parseMappedAttribute(MappedAttribute*); 53 52 54 virtual void attach(); 53 void close();54 virtual void willRemove();55 55 virtual void detach(); 56 56 57 virtual bool rendererIsNeeded(RenderStyle*); 57 58 virtual RenderObject *createRenderer(RenderArena*, RenderStyle*); 59 60 void insertedIntoDocument(); 61 virtual void willRemove(); 62 63 void close(); 58 64 59 65 bool noResize() { return m_noResize; } … … 66 72 Frame* contentFrame() const; 67 73 Document* contentDocument() const; 74 HTMLFrameSetElement* containingFrameSetElement() const; 68 75 69 76 virtual bool isURLAttribute(Attribute*) const; -
trunk/WebCore/html/HTMLIFrameElement.cpp
r16661 r16703 40 40 HTMLIFrameElement::HTMLIFrameElement(Document* doc) 41 41 : HTMLFrameElement(iframeTag, doc) 42 , needWidgetUpdate(false)43 42 { 44 43 m_frameBorder = false; … … 61 60 } 62 61 63 return HTML Element::mapToEntry(attrName, result);62 return HTMLFrameElement::mapToEntry(attrName, result); 64 63 } 65 64 … … 86 85 void HTMLIFrameElement::insertedIntoDocument() 87 86 { 87 HTMLFrameElement::insertedIntoDocument(); 88 88 89 if (document()->isHTMLDocument()) { 89 90 HTMLDocument *doc = static_cast<HTMLDocument *>(document()); … … 91 92 } 92 93 93 HTMLElement::insertedIntoDocument(); 94 95 // Load the frame 96 m_name = getAttribute(nameAttr); 97 if (m_name.isNull()) 98 m_name = getAttribute(idAttr); 99 100 if (Frame* parentFrame = document()->frame()) { 101 m_name = parentFrame->tree()->uniqueChildName(m_name); 102 103 openURL(); 104 } 94 openURL(); 105 95 } 106 96 … … 123 113 } 124 114 125 HTML Element::removedFromDocument();115 HTMLFrameElement::removedFromDocument(); 126 116 } 127 117 … … 139 129 void HTMLIFrameElement::attach() 140 130 { 141 HTML Element::attach();131 HTMLFrameElement::attach(); 142 132 143 RenderPartObject* renderPart = static_cast<RenderPartObject*>(renderer()); 144 145 if (renderPart) { 146 if (!contentFrame()) 147 openURL(); 148 133 if (RenderPartObject* renderPart = static_cast<RenderPartObject*>(renderer())) { 149 134 if (contentFrame()) { 150 135 renderPart->setWidget(contentFrame()->view()); 151 136 renderPart->updateWidget(); 152 needWidgetUpdate = false;153 137 } 154 138 } … … 158 142 { 159 143 HTMLElement::detach(); 160 }161 162 void HTMLIFrameElement::recalcStyle( StyleChange ch )163 {164 if (needWidgetUpdate) {165 if (renderer())166 static_cast<RenderPartObject*>(renderer())->updateWidget();167 needWidgetUpdate = false;168 }169 HTMLElement::recalcStyle( ch );170 144 } 171 145 -
trunk/WebCore/html/HTMLIFrameElement.h
r16661 r16703 51 51 virtual bool rendererIsNeeded(RenderStyle*); 52 52 virtual RenderObject *createRenderer(RenderArena*, RenderStyle*); 53 virtual void recalcStyle(StyleChange);54 53 55 54 virtual bool isURLAttribute(Attribute*) const; … … 64 63 void setWidth(const String&); 65 64 66 protected: 67 bool needWidgetUpdate; 68 69 private: 65 private: 70 66 String oldNameAttr; 71 67 };
Note: See TracChangeset
for help on using the changeset viewer.