Changeset 68114 in webkit


Ignore:
Timestamp:
Sep 22, 2010 7:08:30 PM (14 years ago)
Author:
mihaip@chromium.org
Message:

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):
Location:
trunk
Files:
2 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r68109 r68114  
     12010-09-22  Mihai Parparita  <mihaip@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] User style layout tests don't pass on Chromium
     6        https://bugs.webkit.org/show_bug.cgi?id=46069
     7
     8        User style tests should now pass with the Chromium DRT since we now
     9        apply the styles immediately, just like the other ports (once we also
     10        remove some bad baselines for user-style-top-frame-only added by
     11        r62958).
     12       
     13        Tests still don't pass with test_shell until it starts to use
     14        InjectInExistingDocuments too.
     15
     16        * platform/chromium-mac/userscripts/user-style-top-frame-only-expected.txt: Removed.
     17        * platform/chromium-win/userscripts/user-style-top-frame-only-expected.txt: Removed.
     18        * platform/chromium/drt_expectations.txt:
     19       
    1202010-09-22  Kinuko Yasuda  <kinuko@chromium.org>
    221
  • trunk/LayoutTests/platform/chromium/drt_expectations.txt

    r68013 r68114  
    141141BUG_DRT : platform/chromium/accessibility = PASS
    142142BUG_DRT : userscripts/user-script-top-frame-only.html = PASS
     143BUG_DRT : userscripts/mixed-case-stylesheet.html = PASS
     144BUG_DRT : userscripts/simple-stylesheet.html = PASS
     145BUG_DRT : userscripts/user-style-all-frames.html = PASS
     146BUG_DRT : userscripts/user-style-top-frame-only.html = PASS
  • trunk/WebCore/ChangeLog

    r68112 r68114  
     12010-09-22  Mihai Parparita  <mihaip@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] User style layout tests don't pass on Chromium
     6        https://bugs.webkit.org/show_bug.cgi?id=46069
     7       
     8        Instead of making resetUserStyleCacheInAllFrames be a no-op for
     9        Chromium, have it be controlled by a UserStyleInjectionTime enum.
     10       
     11        Also move the UserStyleSheet::Level enum to be inside
     12        UserStyleSheetTypes for consistency.
     13
     14        * WebCore.exp.in:
     15        * dom/Document.cpp:
     16        (WebCore::Document::pageGroupUserSheets):
     17        * page/PageGroup.cpp:
     18        (WebCore::PageGroup::addUserStyleSheetToWorld):
     19        * page/PageGroup.h:
     20        * page/UserStyleSheet.h:
     21        (WebCore::UserStyleSheet::UserStyleSheet):
     22        (WebCore::UserStyleSheet::level):
     23        * page/UserStyleSheetTypes.h:
     24
    1252010-09-22  Ruben  <chromium@hybridsource.org>
    226
  • trunk/WebCore/WebCore.exp.in

    r68054 r68114  
    829829__ZN7WebCore9PageGroup20removeAllUserContentEv
    830830__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
    831 __ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesENS_14UserStyleSheet5LevelE
     831__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesENS_14UserStyleLevelENS_22UserStyleInjectionTimeE
    832832__ZN7WebCore9PageGroup25removeUserScriptFromWorldEPNS_15DOMWrapperWorldERKNS_4KURLE
    833833__ZN7WebCore9PageGroup26removeUserScriptsFromWorldEPNS_15DOMWrapperWorldE
  • trunk/WebCore/dom/Document.cpp

    r68096 r68114  
    23092309                continue;
    23102310            RefPtr<CSSStyleSheet> parsedSheet = CSSStyleSheet::createInline(const_cast<Document*>(this), sheet->url());
    2311             parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleSheet::UserLevel);
     2311            parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleUserLevel);
    23122312            parsedSheet->parseString(sheet->source(), !inQuirksMode());
    23132313            if (!m_pageGroupUserSheets)
  • trunk/WebCore/page/PageGroup.cpp

    r66247 r68114  
    241241                                         PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
    242242                                         UserContentInjectedFrames injectedFrames,
    243                                          UserStyleSheet::Level level)
     243                                         UserStyleLevel level,
     244                                         UserStyleInjectionTime injectionTime)
    244245{
    245246    ASSERT_ARG(world, world);
     
    253254    styleSheetsInWorld->append(userStyleSheet.release());
    254255
    255     resetUserStyleCacheInAllFrames();
     256    if (injectionTime == InjectInExistingDocuments)
     257        resetUserStyleCacheInAllFrames();
    256258}
    257259
     
    359361void PageGroup::resetUserStyleCacheInAllFrames()
    360362{
    361 #if !PLATFORM(CHROMIUM)
    362363    // Clear our cached sheets and have them just reparse.
    363364    HashSet<Page*>::const_iterator end = m_pages.end();
     
    366367            frame->document()->updatePageGroupUserSheets();
    367368    }
    368 #endif
    369369}
    370370
  • trunk/WebCore/page/PageGroup.h

    r65670 r68114  
    8484                                      PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
    8585                                      UserContentInjectedFrames,
    86                                       UserStyleSheet::Level level = UserStyleSheet::UserLevel);
    87 
     86                                      UserStyleLevel level = UserStyleUserLevel,
     87                                      UserStyleInjectionTime injectionTime = InjectInExistingDocuments);
    8888        void removeUserScriptFromWorld(DOMWrapperWorld*, const KURL&);
    8989        void removeUserStyleSheetFromWorld(DOMWrapperWorld*, const KURL&);
  • trunk/WebCore/page/UserStyleSheet.h

    r65273 r68114  
    3838class UserStyleSheet : public Noncopyable {
    3939public:
    40     enum Level {
    41         UserLevel,
    42         AuthorLevel
    43     };
    44 
    4540    UserStyleSheet(const String& source, const KURL& url,
    4641                   PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
    47                    UserContentInjectedFrames injectedFrames, Level level)
     42                   UserContentInjectedFrames injectedFrames, UserStyleLevel level)
    4843        : m_source(source)
    4944        , m_url(url)
     
    6055    const Vector<String>* blacklist() const { return m_blacklist.get(); }
    6156    UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
    62     Level level() const { return m_level; }
     57    UserStyleLevel level() const { return m_level; }
    6358
    6459private:
     
    6863    OwnPtr<Vector<String> > m_blacklist;
    6964    UserContentInjectedFrames m_injectedFrames;
    70     Level m_level;
     65    UserStyleLevel m_level;
    7166};
    7267
  • trunk/WebCore/page/UserStyleSheetTypes.h

    r50907 r68114  
    3232namespace WebCore {
    3333
     34enum UserStyleInjectionTime { InjectInExistingDocuments, InjectInSubsequentDocuments };
     35enum UserStyleLevel { UserStyleUserLevel, UserStyleAuthorLevel };
     36
    3437class DOMWrapperWorld;
    3538class UserStyleSheet;
  • trunk/WebKit/chromium/ChangeLog

    r68113 r68114  
     12010-09-22  Mihai Parparita  <mihaip@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] User style layout tests don't pass on Chromium
     6        https://bugs.webkit.org/show_bug.cgi?id=46069
     7       
     8        Expose UserStyleInjectionTime in WebView.
     9
     10        * public/WebView.h:
     11        * src/WebViewImpl.cpp:
     12        (WebKit::WebView::addUserStyleSheet):
     13
    1142010-09-22  James Robinson  <jamesr@chromium.org>
    215
  • trunk/WebKit/chromium/public/WebView.h

    r68000 r68114  
    6666        UserContentInjectInTopFrameOnly
    6767    };
     68   
     69    // Controls which documents user styles are injected into.
     70    enum UserStyleInjectionTime {
     71        UserStyleInjectInExistingDocuments,
     72        UserStyleInjectInSubsequentDocuments
     73    };
     74   
    6875
    6976    // Initialization ------------------------------------------------------
     
    329336    WEBKIT_API static void addUserStyleSheet(const WebString& sourceCode,
    330337                                             const WebVector<WebString>& patterns,
    331                                              UserContentInjectIn injectIn);
     338                                             UserContentInjectIn injectIn,
     339                                             UserStyleInjectionTime injectionTime = UserStyleInjectInSubsequentDocuments);
    332340    WEBKIT_API static void removeAllUserContent();
    333341
  • trunk/WebKit/chromium/src/AssertMatchingEnums.cpp

    r68012 r68114  
    5050#include "UserContentTypes.h"
    5151#include "UserScriptTypes.h"
     52#include "UserStyleSheetTypes.h"
    5253#include "VideoFrameChromium.h"
    5354#include "WebAccessibilityObject.h"
     
    354355COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInAllFrames, InjectInAllFrames);
    355356COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInTopFrameOnly, InjectInTopFrameOnly);
     357COMPILE_ASSERT_MATCHING_ENUM(WebView::UserStyleInjectInExistingDocuments, InjectInExistingDocuments);
     358COMPILE_ASSERT_MATCHING_ENUM(WebView::UserStyleInjectInSubsequentDocuments, InjectInSubsequentDocuments);
    356359
    357360COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NullType, IDBKey::NullType);
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r68112 r68114  
    20162016void WebView::addUserStyleSheet(const WebString& sourceCode,
    20172017                                const WebVector<WebString>& patternsIn,
    2018                                 WebView::UserContentInjectIn injectIn)
     2018                                WebView::UserContentInjectIn injectIn,
     2019                                WebView::UserStyleInjectionTime injectionTime)
    20192020{
    20202021    OwnPtr<Vector<String> > patterns(new Vector<String>);
     
    20312032    pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns.release(), 0,
    20322033                                        static_cast<UserContentInjectedFrames>(injectIn),
    2033                                         UserStyleSheet::AuthorLevel);
     2034                                        UserStyleAuthorLevel,
     2035                                        static_cast<WebCore::UserStyleInjectionTime>(injectionTime));
    20342036}
    20352037
  • trunk/WebKitTools/ChangeLog

    r68107 r68114  
     12010-09-22  Mihai Parparita  <mihaip@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] User style layout tests don't pass on Chromium
     6        https://bugs.webkit.org/show_bug.cgi?id=46069
     7
     8        Fix a typo in LayoutTestController::addUserStyleSheet that was causing a
     9        crash the Chromium DRT. Pass InjectInExistingDocuments to mimic DRT
     10        behavior from other ports.
     11
     12        * DumpRenderTree/chromium/LayoutTestController.cpp:
     13        (LayoutTestController::addUserStyleSheet):
     14
    1152010-09-22  Brent Fulgham  <bfulgham@webkit.org>
    216
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp

    r67809 r68114  
    14441444    WebView::addUserStyleSheet(
    14451445        cppVariantToWebString(arguments[0]), WebVector<WebString>(),
    1446         arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly);
     1446        arguments[1].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly,
     1447        // Chromium defaults to InjectInSubsequentDocuments, but for compatibility
     1448        // with the other ports' DRTs, we use UserStyleInjectInExistingDocuments.
     1449        WebView::UserStyleInjectInExistingDocuments);
    14471450}
    14481451
Note: See TracChangeset for help on using the changeset viewer.