homepage-fixes.patch.txt [plain text]
Index: ChangeLog
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/ChangeLog,v
retrieving revision 1.1138
diff -u -p -r1.1138 ChangeLog
--- ChangeLog 2002/12/16 22:01:00 1.1138
+++ ChangeLog 2002/12/16 22:15:17
@@ -1,3 +1,25 @@
+2002-12-16 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Darin.
+
+ - fixed 3125412 - HOMEPAGE: 2nd load of html in the same div fails.
+ - fixed 3052113 - HOMEPAGE: "site menu" part of .mac home page editing doesn't work
+ - fixed 3075392 - HOMEPAGE: "pages" section of mac.com homepage editing is missing
+
+ * khtml/html/html_baseimpl.h:
+ * khtml/html/html_baseimpl.cpp:
+ (HTMLFrameElementImpl::updateForNewURL): Function that loads new URL,
+ to be called if src attribute is set explicitly and the element is already
+ attached.
+ (HTMLFrameElementImpl::parseAttribute): Call updateForNewURL when src
+ attrinute is set.
+ (HTMLFrameElementImpl::contentDocument): Don't involve render widget
+ in getting the content document.
+ * khtml/html/html_elementimpl.cpp:
+ (HTMLElementImpl::createContextualFragment): Allow contextual
+ fragments to be created (and therefore innerHTML to be set on) TR
+ and HTML elements.
+
2002-12-16 David Hyatt <hyatt@apple.com>
Code needs to go in calcMinMaxWidth instead, so parents computing
Index: khtml/html/html_baseimpl.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/html/html_baseimpl.cpp,v
retrieving revision 1.12
diff -u -p -r1.12 khtml/html/html_baseimpl.cpp
--- khtml/html/html_baseimpl.cpp 2002/12/16 02:42:31 1.12
+++ khtml/html/html_baseimpl.cpp 2002/12/16 22:15:18
@@ -227,12 +227,37 @@ NodeImpl::Id HTMLFrameElementImpl::id()
return ID_FRAME;
}
+void HTMLFrameElementImpl::updateForNewURL()
+{
+ if (attached()) {
+ // ignore display: none for this element!
+ KHTMLView* w = getDocument()->view();
+ // avoid endless recursion
+ KURL u;
+ if (!url.isEmpty()) u = getDocument()->completeURL( url.string() );
+ bool selfreference = false;
+ for (KHTMLPart* part = w->part(); part; part = part->parentPart())
+ if (part->url() == u) {
+ selfreference = true;
+ break;
+ }
+
+ // load the frame contents
+ if ( !url.isEmpty() && !(w->part()->onlyLocalReferences() && u.protocol() != "file")) {
+ KHTMLPart *part = w->part()->findFrame( name.string() );
+ part->openURL(u);
+ }
+ }
+}
+
+
void HTMLFrameElementImpl::parseAttribute(AttributeImpl *attr)
{
switch(attr->id())
{
case ATTR_SRC:
url = khtml::parseURL(attr->val());
+ updateForNewURL();
break;
case ATTR_ID:
case ATTR_NAME:
@@ -363,12 +388,12 @@ void HTMLFrameElementImpl::setFocus(bool
DocumentImpl* HTMLFrameElementImpl::contentDocument() const
{
- if ( !m_render ) return 0;
-
- RenderPart* render = static_cast<RenderPart*>( m_render );
+ KHTMLView* w = getDocument()->view();
- if(render->widget() && render->widget()->inherits("KHTMLView"))
- return static_cast<KHTMLView*>( render->widget() )->part()->xmlDocImpl();
+ if (w) {
+ KHTMLPart *part = w->part()->findFrame( name.string() );
+ return part->xmlDocImpl();
+ }
return 0;
}
Index: khtml/html/html_baseimpl.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/html/html_baseimpl.h,v
retrieving revision 1.5
diff -u -p -r1.5 khtml/html/html_baseimpl.h
--- khtml/html/html_baseimpl.h 2002/10/26 23:21:43 1.5
+++ khtml/html/html_baseimpl.h 2002/12/16 22:15:18
@@ -112,6 +112,9 @@ protected:
bool frameBorder : 1;
bool frameBorderSet : 1;
bool noresize : 1;
+
+ private:
+ void updateForNewURL();
};
// -------------------------------------------------------------------------
Index: khtml/html/html_elementimpl.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/html/html_elementimpl.cpp,v
retrieving revision 1.8
diff -u -p -r1.8 khtml/html/html_elementimpl.cpp
--- khtml/html/html_elementimpl.cpp 2002/12/05 03:29:01 1.8
+++ khtml/html/html_elementimpl.cpp 2002/12/16 22:15:18
@@ -301,14 +301,12 @@ DocumentFragmentImpl *HTMLElementImpl::c
case ID_COLGROUP:
case ID_FRAMESET:
case ID_HEAD:
- case ID_HTML:
case ID_STYLE:
case ID_TABLE:
case ID_TBODY:
case ID_TFOOT:
case ID_THEAD:
case ID_TITLE:
- case ID_TR:
return NULL;
default:
break;