Commit c419780b authored by mihaip@chromium.org's avatar mihaip@chromium.org

2010-09-22 Mihai Parparita <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] User style layout tests don't pass on Chromium
        https://bugs.webkit.org/show_bug.cgi?id=46069

        User style tests should now pass with the Chromium DRT since we now
        apply the styles immediately, just like the other ports (once we also
        remove some bad baselines for user-style-top-frame-only added by
        r62958).

        Tests still don't pass with test_shell until it starts to use
        InjectInExistingDocuments too.

        * platform/chromium-mac/userscripts/user-style-top-frame-only-expected.txt: Removed.
        * platform/chromium-win/userscripts/user-style-top-frame-only-expected.txt: Removed.
        * platform/chromium/drt_expectations.txt:
2010-09-22  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] User style layout tests don't pass on Chromium
        https://bugs.webkit.org/show_bug.cgi?id=46069

        Instead of making resetUserStyleCacheInAllFrames be a no-op for
        Chromium, have it be controlled by a UserStyleInjectionTime enum.

        Also move the UserStyleSheet::Level enum to be inside
        UserStyleSheetTypes for consistency.

        * WebCore.exp.in:
        * dom/Document.cpp:
        (WebCore::Document::pageGroupUserSheets):
        * page/PageGroup.cpp:
        (WebCore::PageGroup::addUserStyleSheetToWorld):
        * page/PageGroup.h:
        * page/UserStyleSheet.h:
        (WebCore::UserStyleSheet::UserStyleSheet):
        (WebCore::UserStyleSheet::level):
        * page/UserStyleSheetTypes.h:
2010-09-22  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] User style layout tests don't pass on Chromium
        https://bugs.webkit.org/show_bug.cgi?id=46069

        Expose UserStyleInjectionTime in WebView.

        * public/WebView.h:
        * src/WebViewImpl.cpp:
        (WebKit::WebView::addUserStyleSheet):
2010-09-22  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] User style layout tests don't pass on Chromium
        https://bugs.webkit.org/show_bug.cgi?id=46069

        Fix a typo in LayoutTestController::addUserStyleSheet that was causing a
        crash the Chromium DRT. Pass InjectInExistingDocuments to mimic DRT
        behavior from other ports.

        * DumpRenderTree/chromium/LayoutTestController.cpp:
        (LayoutTestController::addUserStyleSheet):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9e0aea63
2010-09-22 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
[Chromium] User style layout tests don't pass on Chromium
https://bugs.webkit.org/show_bug.cgi?id=46069
User style tests should now pass with the Chromium DRT since we now
apply the styles immediately, just like the other ports (once we also
remove some bad baselines for user-style-top-frame-only added by
r62958).
Tests still don't pass with test_shell until it starts to use
InjectInExistingDocuments too.
* platform/chromium-mac/userscripts/user-style-top-frame-only-expected.txt: Removed.
* platform/chromium-win/userscripts/user-style-top-frame-only-expected.txt: Removed.
* platform/chromium/drt_expectations.txt:
2010-09-22 Kinuko Yasuda <kinuko@chromium.org>
Unreviewed, temporarily disabling the new filesystem test on chromium.
2 thingers should appear on this page. Otherwise the test has failed.
--------
Frame: '<!--framePath //<!--frame0-->-->'
--------
--------
Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
--------
2 thingers should appear on this page. Otherwise the test has failed.
--------
Frame: '<!--framePath //<!--frame0-->-->'
--------
--------
Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
--------
......@@ -140,3 +140,7 @@ BUG_DRT WIN : fast/notifications/notifications-replace.html = TEXT
// PASS with DRT though FAIL on test_shell
BUG_DRT : platform/chromium/accessibility = PASS
BUG_DRT : userscripts/user-script-top-frame-only.html = PASS
BUG_DRT : userscripts/mixed-case-stylesheet.html = PASS
BUG_DRT : userscripts/simple-stylesheet.html = PASS
BUG_DRT : userscripts/user-style-all-frames.html = PASS
BUG_DRT : userscripts/user-style-top-frame-only.html = PASS
2010-09-22 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
[Chromium] User style layout tests don't pass on Chromium
https://bugs.webkit.org/show_bug.cgi?id=46069
Instead of making resetUserStyleCacheInAllFrames be a no-op for
Chromium, have it be controlled by a UserStyleInjectionTime enum.
Also move the UserStyleSheet::Level enum to be inside
UserStyleSheetTypes for consistency.
* WebCore.exp.in:
* dom/Document.cpp:
(WebCore::Document::pageGroupUserSheets):
* page/PageGroup.cpp:
(WebCore::PageGroup::addUserStyleSheetToWorld):
* page/PageGroup.h:
* page/UserStyleSheet.h:
(WebCore::UserStyleSheet::UserStyleSheet):
(WebCore::UserStyleSheet::level):
* page/UserStyleSheetTypes.h:
2010-09-22 Ruben <chromium@hybridsource.org>
Reviewed by Tony Chang.
......@@ -828,7 +828,7 @@ __ZN7WebCore9PageGroup18addVisitedLinkHashEy
__ZN7WebCore9PageGroup20addUserScriptToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
__ZN7WebCore9PageGroup20removeAllUserContentEv
__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesENS_14UserStyleSheet5LevelE
__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesENS_14UserStyleLevelENS_22UserStyleInjectionTimeE
__ZN7WebCore9PageGroup25removeUserScriptFromWorldEPNS_15DOMWrapperWorldERKNS_4KURLE
__ZN7WebCore9PageGroup26removeUserScriptsFromWorldEPNS_15DOMWrapperWorldE
__ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
......
......@@ -2308,7 +2308,7 @@ const Vector<RefPtr<CSSStyleSheet> >* Document::pageGroupUserSheets() const
if (!UserContentURLPattern::matchesPatterns(url(), sheet->whitelist(), sheet->blacklist()))
continue;
RefPtr<CSSStyleSheet> parsedSheet = CSSStyleSheet::createInline(const_cast<Document*>(this), sheet->url());
parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleSheet::UserLevel);
parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleUserLevel);
parsedSheet->parseString(sheet->source(), !inQuirksMode());
if (!m_pageGroupUserSheets)
m_pageGroupUserSheets.set(new Vector<RefPtr<CSSStyleSheet> >);
......
......@@ -240,7 +240,8 @@ void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& sourc
void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
UserContentInjectedFrames injectedFrames,
UserStyleSheet::Level level)
UserStyleLevel level,
UserStyleInjectionTime injectionTime)
{
ASSERT_ARG(world, world);
......@@ -252,7 +253,8 @@ void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& s
styleSheetsInWorld = new UserStyleSheetVector;
styleSheetsInWorld->append(userStyleSheet.release());
resetUserStyleCacheInAllFrames();
if (injectionTime == InjectInExistingDocuments)
resetUserStyleCacheInAllFrames();
}
void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld* world, const KURL& url)
......@@ -358,14 +360,12 @@ void PageGroup::removeAllUserContent()
void PageGroup::resetUserStyleCacheInAllFrames()
{
#if !PLATFORM(CHROMIUM)
// Clear our cached sheets and have them just reparse.
HashSet<Page*>::const_iterator end = m_pages.end();
for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
frame->document()->updatePageGroupUserSheets();
}
#endif
}
} // namespace WebCore
......@@ -83,8 +83,8 @@ namespace WebCore {
void addUserStyleSheetToWorld(DOMWrapperWorld*, const String& source, const KURL&,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
UserContentInjectedFrames,
UserStyleSheet::Level level = UserStyleSheet::UserLevel);
UserStyleLevel level = UserStyleUserLevel,
UserStyleInjectionTime injectionTime = InjectInExistingDocuments);
void removeUserScriptFromWorld(DOMWrapperWorld*, const KURL&);
void removeUserStyleSheetFromWorld(DOMWrapperWorld*, const KURL&);
......
......@@ -37,14 +37,9 @@ namespace WebCore {
class UserStyleSheet : public Noncopyable {
public:
enum Level {
UserLevel,
AuthorLevel
};
UserStyleSheet(const String& source, const KURL& url,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
UserContentInjectedFrames injectedFrames, Level level)
UserContentInjectedFrames injectedFrames, UserStyleLevel level)
: m_source(source)
, m_url(url)
, m_whitelist(whitelist)
......@@ -59,7 +54,7 @@ public:
const Vector<String>* whitelist() const { return m_whitelist.get(); }
const Vector<String>* blacklist() const { return m_blacklist.get(); }
UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
Level level() const { return m_level; }
UserStyleLevel level() const { return m_level; }
private:
String m_source;
......@@ -67,7 +62,7 @@ private:
OwnPtr<Vector<String> > m_whitelist;
OwnPtr<Vector<String> > m_blacklist;
UserContentInjectedFrames m_injectedFrames;
Level m_level;
UserStyleLevel m_level;
};
} // namespace WebCore
......
......@@ -31,6 +31,9 @@
namespace WebCore {
enum UserStyleInjectionTime { InjectInExistingDocuments, InjectInSubsequentDocuments };
enum UserStyleLevel { UserStyleUserLevel, UserStyleAuthorLevel };
class DOMWrapperWorld;
class UserStyleSheet;
......
2010-09-22 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
[Chromium] User style layout tests don't pass on Chromium
https://bugs.webkit.org/show_bug.cgi?id=46069
Expose UserStyleInjectionTime in WebView.
* public/WebView.h:
* src/WebViewImpl.cpp:
(WebKit::WebView::addUserStyleSheet):
2010-09-22 James Robinson <jamesr@chromium.org>
[chromium] Re-synchronizes features.gypi with upstream feature_overrides.gypi.
......
......@@ -65,6 +65,13 @@ public:
UserContentInjectInAllFrames,
UserContentInjectInTopFrameOnly
};
// Controls which documents user styles are injected into.
enum UserStyleInjectionTime {
UserStyleInjectInExistingDocuments,
UserStyleInjectInSubsequentDocuments
};
// Initialization ------------------------------------------------------
......@@ -328,7 +335,8 @@ public:
UserContentInjectIn injectIn);
WEBKIT_API static void addUserStyleSheet(const WebString& sourceCode,
const WebVector<WebString>& patterns,
UserContentInjectIn injectIn);
UserContentInjectIn injectIn,
UserStyleInjectionTime injectionTime = UserStyleInjectInSubsequentDocuments);
WEBKIT_API static void removeAllUserContent();
// Modal dialog support ------------------------------------------------
......
......@@ -49,6 +49,7 @@
#include "TextAffinity.h"
#include "UserContentTypes.h"
#include "UserScriptTypes.h"
#include "UserStyleSheetTypes.h"
#include "VideoFrameChromium.h"
#include "WebAccessibilityObject.h"
#include "WebApplicationCacheHost.h"
......@@ -353,6 +354,8 @@ COMPILE_ASSERT_MATCHING_ENUM(WebView::UserScriptInjectAtDocumentStart, InjectAtD
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserScriptInjectAtDocumentEnd, InjectAtDocumentEnd);
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInAllFrames, InjectInAllFrames);
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInTopFrameOnly, InjectInTopFrameOnly);
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserStyleInjectInExistingDocuments, InjectInExistingDocuments);
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserStyleInjectInSubsequentDocuments, InjectInSubsequentDocuments);
COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NullType, IDBKey::NullType);
COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType);
......
......@@ -2015,7 +2015,8 @@ void WebView::addUserScript(const WebString& sourceCode,
void WebView::addUserStyleSheet(const WebString& sourceCode,
const WebVector<WebString>& patternsIn,
WebView::UserContentInjectIn injectIn)
WebView::UserContentInjectIn injectIn,
WebView::UserStyleInjectionTime injectionTime)
{
OwnPtr<Vector<String> > patterns(new Vector<String>);
for (size_t i = 0; i < patternsIn.size(); ++i)
......@@ -2030,7 +2031,8 @@ void WebView::addUserStyleSheet(const WebString& sourceCode,
// FIXME: It would be nice to populate the URL correctly, instead of passing an empty URL.
pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns.release(), 0,
static_cast<UserContentInjectedFrames>(injectIn),
UserStyleSheet::AuthorLevel);
UserStyleAuthorLevel,
static_cast<WebCore::UserStyleInjectionTime>(injectionTime));
}
void WebView::removeAllUserContent()
......
2010-09-22 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
[Chromium] User style layout tests don't pass on Chromium
https://bugs.webkit.org/show_bug.cgi?id=46069
Fix a typo in LayoutTestController::addUserStyleSheet that was causing a
crash the Chromium DRT. Pass InjectInExistingDocuments to mimic DRT
behavior from other ports.
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::addUserStyleSheet):
2010-09-22 Brent Fulgham <bfulgham@webkit.org>
Reviewed by Martin Robinson.
......
......@@ -1443,7 +1443,10 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C
return;
WebView::addUserStyleSheet(
cppVariantToWebString(arguments[0]), WebVector<WebString>(),
arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly);
arguments[1].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly,
// Chromium defaults to InjectInSubsequentDocuments, but for compatibility
// with the other ports' DRTs, we use UserStyleInjectInExistingDocuments.
WebView::UserStyleInjectInExistingDocuments);
}
void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments, CppVariant* results)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment