Changeset 83252 in webkit
- Timestamp:
- Apr 7, 2011 9:59:33 PM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r83249 r83252 1 2011-04-07 Magnus Danielsson <public@fuzzac.com> 2 3 Reviewed by Darin Fisher. 4 5 [chromium] WebPageSerializerImpl doesn't serialize sub-frames correctly 6 https://bugs.webkit.org/show_bug.cgi?id=53897 7 8 When serializing a web page using 'save page as', sub-frames and resources gets 9 saved in a sub-directory. However, frame elements didn't get updated to reference 10 these saved sub-frames, but were still referencing the original url. So when opening 11 a saved web page, any sub-frames would get pulled in from the original url rather than 12 what was saved. 13 14 In addition to this, sub-frames in the sub-directory erroneously had the name of the 15 sub-directory prepended to the path of resources located in the same sub-directory. 16 17 * src/WebPageSerializerImpl.cpp: 18 (WebKit::WebPageSerializerImpl::openTagToStrne: Fixed resource paths in sub-frames. 19 Also made sure sub-frames are referenced correctly from parent frame. 20 (WebKit::WebPageSerializerImpl::endTagToString): Removed constness from argument. 21 (WebKit::WebPageSerializerImpl::buildContentForNode): Ditto. 22 * src/WebPageSerializerImpl.h: 23 1 24 2011-04-07 Nat Duca <nduca@chromium.org> 2 25 -
trunk/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
r79123 r83252 296 296 } 297 297 298 void WebPageSerializerImpl::openTagToString( constElement* element,298 void WebPageSerializerImpl::openTagToString(Element* element, 299 299 SerializeDomParam* param) 300 300 { … … 329 329 else { 330 330 // Get the absolute link 331 String completeURL = param->document->completeURL(attrValue); 331 WebFrameImpl* subFrame = WebFrameImpl::fromFrameOwnerElement(element); 332 String completeURL = subFrame ? subFrame->frame()->document()->url() : 333 param->document->completeURL(attrValue); 332 334 // Check whether we have local files for those link. 333 335 if (m_localLinks.contains(completeURL)) { 334 if (! m_localDirectoryName.isEmpty())335 result += "./" + m_localDirectoryName + "/";336 if (!param->directoryName.isEmpty()) 337 result += "./" + param->directoryName + "/"; 336 338 result += m_localLinks.get(completeURL); 337 339 } else … … 361 363 362 364 // Serialize end tag of an specified element. 363 void WebPageSerializerImpl::endTagToString( constElement* element,365 void WebPageSerializerImpl::endTagToString(Element* element, 364 366 SerializeDomParam* param) 365 367 { … … 398 400 } 399 401 400 void WebPageSerializerImpl::buildContentForNode( constNode* node,402 void WebPageSerializerImpl::buildContentForNode(Node* node, 401 403 SerializeDomParam* param) 402 404 { … … 404 406 case Node::ELEMENT_NODE: 405 407 // Process open tag of element. 406 openTagToString(static_cast< constElement*>(node), param);408 openTagToString(static_cast<Element*>(node), param); 407 409 // Walk through the children nodes and process it. 408 for ( constNode *child = node->firstChild(); child; child = child->nextSibling())410 for (Node *child = node->firstChild(); child; child = child->nextSibling()) 409 411 buildContentForNode(child, param); 410 412 // Process end tag of element. 411 endTagToString(static_cast< constElement*>(node), param);413 endTagToString(static_cast<Element*>(node), param); 412 414 break; 413 415 case Node::TEXT_NODE: -
trunk/Source/WebKit/chromium/src/WebPageSerializerImpl.h
r69675 r83252 175 175 FlushOption); 176 176 // Serialize open tag of an specified element. 177 void openTagToString( const WebCore::Element* element,177 void openTagToString(WebCore::Element*, 178 178 SerializeDomParam* param); 179 179 // Serialize end tag of an specified element. 180 void endTagToString( const WebCore::Element* element,180 void endTagToString(WebCore::Element*, 181 181 SerializeDomParam* param); 182 182 // Build content for a specified node 183 void buildContentForNode( const WebCore::Node* node,183 void buildContentForNode(WebCore::Node*, 184 184 SerializeDomParam* param); 185 185 };
Note: See TracChangeset
for help on using the changeset viewer.