From c8aeb60f9d933817a133da0a27260ed037fb9f61 Mon Sep 17 00:00:00 2001 From: Santosh Date: Thu, 2 May 2013 18:16:49 +0900 Subject: [PATCH] Fix for different layout of mhtml saved page http://sports.hankooki.com/lpage/soccer/201304/sp2013042317313793750.htm [Title] Fix for different layout of mhtml saved page in http://sports.hankooki.com/lpage/soccer/201304/sp2013042317313793750.htm [Issue#] TD-9513 [Problem] The Style of saved page was completely different from original page. [Cause] The final path url of sheet specified under @import are not relative to parent stylesheet but relative to document [Solution] Modified the code to calulate final URL path of Stylesheet relative to parent stylesheet. [Developer] Santosh Mahto[santosh.ma@samsung.com) Change-Id: Ic9624339de4d39be205119c15e529f22f6067064 --- Source/WTF/wtf/Platform.h | 2 ++ Source/WebCore/page/PageSerializer.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index ec796fb..b856177 100644 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -789,6 +789,8 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/ #define ENABLE_TIZEN_CSP 1 /* Seonae Kim(sunaeluv.kim@samsung.com) : Support CSP to provide EWK API to web applicatoin */ #define ENABLE_TIZEN_SUPPORT_MHTML 1 /* KwangYong Choi(ky0.choi@samsung.com) : Add support for exporting MHTML data */ +#define ENABLE_TIZEN_MHTML_CSS_IMPORT_URL_RELATIVE_TO_PARENT 1 /*Santosh Mahto(santosh.ma@samsung.com) : URL of stylesheet specified in @import should be relative to parent Stylesheet in page Serializing */ + #define ENABLE_TIZEN_OFFLINE_PAGE_SAVE 1 /* Nikhil Bansal (n.bansal@samsung.com) : Tizen feature for offline page save */ #define ENABLE_TIZEN_SIGNAL_APP_BACK_FORWARD_LIST_CHANGED 1 /* Praveen(praveen.ks@samsung.com) : Add API to signal application for change in back forward list */ diff --git a/Source/WebCore/page/PageSerializer.cpp b/Source/WebCore/page/PageSerializer.cpp index 6ada614..a9e9cd3 100644 --- a/Source/WebCore/page/PageSerializer.cpp +++ b/Source/WebCore/page/PageSerializer.cpp @@ -271,7 +271,11 @@ void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const KUR // Some rules have resources associated with them that we need to retrieve. if (rule->isImportRule()) { CSSImportRule* importRule = static_cast(rule); +#if ENABLE(TIZEN_MHTML_CSS_IMPORT_URL_RELATIVE_TO_PARENT) + KURL importURL = document->completeURL(KURL(styleSheet->baseURL(), importRule->href())); +#else KURL importURL = document->completeURL(importRule->href()); +#endif if (m_resourceURLs.contains(importURL)) continue; serializeCSSStyleSheet(importRule->styleSheet(), importURL); -- 2.7.4