Diff
Modified: branches/chromium/1312/ChangeLog (136959 => 136960)
--- branches/chromium/1312/ChangeLog 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/ChangeLog 2012-12-07 18:07:59 UTC (rev 136960)
@@ -1,3 +1,14 @@
+2012-12-06 Tony Chang <t...@chromium.org>
+
+ REGRESSION(r135082): Restore the ability to insert author level style sheets from script
+ https://bugs.webkit.org/show_bug.cgi?id=104042
+
+ Reviewed by Antti Koivisto.
+
+ Update exports for Internals.cpp.
+
+ * Source/autotools/symbols.filter:
+
2012-11-01 Ami Fischman <fisch...@chromium.org>
HTMLMediaPlayer should free m_player when src is set/changed
Modified: branches/chromium/1312/LayoutTests/ChangeLog (136959 => 136960)
--- branches/chromium/1312/LayoutTests/ChangeLog 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/LayoutTests/ChangeLog 2012-12-07 18:07:59 UTC (rev 136960)
@@ -1,3 +1,15 @@
+2012-12-06 Tony Chang <t...@chromium.org>
+
+ REGRESSION(r135082): Restore the ability to insert author level style sheets from script
+ https://bugs.webkit.org/show_bug.cgi?id=104042
+
+ Reviewed by Antti Koivisto.
+
+ Add a test that makes sure that an author level style is set.
+
+ * userscripts/insert-stylesheets-expected.txt: Added.
+ * userscripts/insert-stylesheets.html: Added.
+
2012-11-18 Antti Koivisto <an...@apple.com>
REGRESSION(r129644): User StyleSheet not applying
@@ -2060,7 +2072,6 @@
* platform/chromium-win/svg/dynamic-updates/SVGFEComponentTransferElement-svgdom-tableValues-prop-expected.png:
* platform/chromium/TestExpectations:
->>>>>>> .r128909
2012-09-18 Julien Chaffraix <jchaffr...@webkit.org>
Tables without any descendant and auto logical width should have a 0px logical width
Copied: branches/chromium/1312/LayoutTests/userscripts/insert-stylesheets-expected.txt (from rev 136878, trunk/LayoutTests/userscripts/insert-stylesheets-expected.txt) (0 => 136960)
--- branches/chromium/1312/LayoutTests/userscripts/insert-stylesheets-expected.txt (rev 0)
+++ branches/chromium/1312/LayoutTests/userscripts/insert-stylesheets-expected.txt 2012-12-07 18:07:59 UTC (rev 136960)
@@ -0,0 +1,9 @@
+PASS getComputedStyle(testElement).backgroundColor is 'rgb(255, 0, 0)'
+PASS testElement.offsetWidth is 0
+PASS getComputedStyle(testElement).backgroundColor is 'rgb(255, 0, 0)'
+PASS testElement.offsetWidth is 0
+PASS getComputedStyle(testElement).backgroundColor is 'rgb(0, 128, 0)'
+PASS testElement.offsetWidth is 100
+This test requires testRunner and window.internals.
+
+
Copied: branches/chromium/1312/LayoutTests/userscripts/insert-stylesheets.html (from rev 136878, trunk/LayoutTests/userscripts/insert-stylesheets.html) (0 => 136960)
--- branches/chromium/1312/LayoutTests/userscripts/insert-stylesheets.html (rev 0)
+++ branches/chromium/1312/LayoutTests/userscripts/insert-stylesheets.html 2012-12-07 18:07:59 UTC (rev 136960)
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+ .styled {
+ background-color: red;
+ width: 0;
+ height: 100px;
+ }
+</style>
+<script src=""
+</head>
+<body>
+<p>This test requires testRunner and window.internals.</p>
+<div id="test" class="styled"></div>
+<script>
+function test()
+{
+ if (!window.testRunner)
+ return;
+ testRunner.dumpAsText();
+ window.testElement = document.getElementById("test");
+ shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(255, 0, 0)'");
+ shouldBe("testElement.offsetWidth", "0");
+
+ if (!window.internals)
+ return;
+
+ // The author style above should override this user style.
+ internals.insertUserCSS(document, "body .styled { background-color: green; width: 100px; }");
+ shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(255, 0, 0)'");
+ shouldBe("testElement.offsetWidth", "0");
+
+ // Since this style is more specific, it should override the original author style above.
+ internals.insertAuthorCSS(document, "body .styled { background-color: green; width: 100px; }");
+ shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(0, 128, 0)'");
+ shouldBe("testElement.offsetWidth", "100");
+}
+
+test();
+</script>
+</body>
+</html>
Modified: branches/chromium/1312/Source/WebCore/ChangeLog (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/ChangeLog 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/ChangeLog 2012-12-07 18:07:59 UTC (rev 136960)
@@ -1,3 +1,31 @@
+2012-12-06 Tony Chang <t...@chromium.org>
+
+ REGRESSION(r135082): Restore the ability to insert author level style sheets from script
+ https://bugs.webkit.org/show_bug.cgi?id=104042
+
+ Reviewed by Antti Koivisto.
+
+ Add DocumentStyleSheetCollection::addAuthorSheet so embedders can allow scripts
+ to insert author level styles. Expose the method to window.interals for testing.
+
+ Test: userscripts/insert-stylesheets.html
+
+ * WebCore.exp.in: Update exports for Internals.cpp.
+ * WebCore.order: Update exports for Internals.cpp.
+ * dom/DocumentStyleSheetCollection.cpp:
+ (WebCore::DocumentStyleSheetCollection::~DocumentStyleSheetCollection):
+ (WebCore::DocumentStyleSheetCollection::addAuthorSheet): Add the stylesheet and force a style recalc.
+ (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Include author level styles.
+ (WebCore::DocumentStyleSheetCollection::reportMemoryUsage): Include author styles.
+ * dom/DocumentStyleSheetCollection.h:
+ (WebCore::DocumentStyleSheetCollection::documentAuthorStyleSheets): Accessor.
+ (DocumentStyleSheetCollection): Keep track of author styles added by script.
+ * testing/Internals.cpp:
+ (WebCore::Internals::insertAuthorCSS): Testing addAuthorSheet.
+ (WebCore::Internals::insertUserCSS): Testing addUserSheet.
+ * testing/Internals.h:
+ * testing/Internals.idl: Add addAuthorSheet and addUserSheet.
+
2012-11-20 Tony Chang <t...@chromium.org>
When calling DocumentStyleSheetCollection::addUserSheet, pass in a user sheet
Modified: branches/chromium/1312/Source/WebCore/WebCore.exp.in (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/WebCore.exp.in 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/WebCore.exp.in 2012-12-07 18:07:59 UTC (rev 136960)
@@ -1472,6 +1472,12 @@
__ZTVN7WebCore17FrameLoaderClientE
__ZTVN7WebCore25HistoryPropertyListWriterE
__ZTVN7WebCore28InspectorFrontendClientLocal8SettingsE
+__ZN7WebCore16CSSParserContextC1EPNS_8DocumentERKNS_4KURLERKN3WTF6StringE
+__ZN7WebCore18StyleSheetContents11parseStringERKN3WTF6StringE
+__ZN7WebCore18StyleSheetContentsC1EPNS_15StyleRuleImportERKN3WTF6StringERKNS_16CSSParserContextE
+__ZN7WebCore18StyleSheetContentsD1Ev
+__ZN7WebCore28DocumentStyleSheetCollection12addUserSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE
+__ZN7WebCore28DocumentStyleSheetCollection14addAuthorSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE
_filenameByFixingIllegalCharacters
_hasCaseInsensitivePrefix
_hasCaseInsensitiveSubstring
Modified: branches/chromium/1312/Source/WebCore/WebCore.order (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/WebCore.order 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/WebCore.order 2012-12-07 18:07:59 UTC (rev 136960)
@@ -31915,3 +31915,9 @@
__ZN7WebCore21jsDocumentOnmousemoveEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
__ZN7WebCore14StorageTracker8isActiveEv
__ZN7WebCore14StorageTracker12deleteOriginERKN3WTF6StringE
+__ZN7WebCore16CSSParserContextC1EPNS_8DocumentERKNS_4KURLERKN3WTF6StringE
+__ZN7WebCore18StyleSheetContents11parseStringERKN3WTF6StringE
+__ZN7WebCore18StyleSheetContentsC1EPNS_15StyleRuleImportERKN3WTF6StringERKNS_16CSSParserContextE
+__ZN7WebCore18StyleSheetContentsD1Ev
+__ZN7WebCore28DocumentStyleSheetCollection12addUserSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE
+__ZN7WebCore28DocumentStyleSheetCollection14addAuthorSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE
Modified: branches/chromium/1312/Source/WebCore/dom/DocumentStyleSheetCollection.cpp (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/dom/DocumentStyleSheetCollection.cpp 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/dom/DocumentStyleSheetCollection.cpp 2012-12-07 18:07:59 UTC (rev 136960)
@@ -81,6 +81,8 @@
m_injectedAuthorStyleSheets[i]->clearOwnerNode();
for (unsigned i = 0; i < m_userStyleSheets.size(); ++i)
m_userStyleSheets[i]->clearOwnerNode();
+ for (unsigned i = 0; i < m_authorStyleSheets.size(); ++i)
+ m_authorStyleSheets[i]->clearOwnerNode();
}
void DocumentStyleSheetCollection::combineCSSFeatureFlags()
@@ -191,6 +193,13 @@
m_document->styleResolverChanged(DeferRecalcStyle);
}
+void DocumentStyleSheetCollection::addAuthorSheet(PassRefPtr<StyleSheetContents> authorSheet)
+{
+ ASSERT(!authorSheet->isUserStyleSheet());
+ m_authorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_document));
+ m_document->styleResolverChanged(RecalcStyleImmediately);
+}
+
void DocumentStyleSheetCollection::addUserSheet(PassRefPtr<StyleSheetContents> userSheet)
{
ASSERT(userSheet->isUserStyleSheet());
@@ -456,6 +465,7 @@
Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets;
activeCSSStyleSheets.append(injectedAuthorStyleSheets());
+ activeCSSStyleSheets.append(documentAuthorStyleSheets());
collectActiveCSSStyleSheetsFromSeamlessParents(activeCSSStyleSheets, m_document);
filterEnabledCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets);
@@ -494,6 +504,7 @@
info.addMember(m_injectedUserStyleSheets);
info.addMember(m_injectedAuthorStyleSheets);
info.addMember(m_userStyleSheets);
+ info.addMember(m_authorStyleSheets);
info.addMember(m_activeAuthorStyleSheets);
info.addMember(m_styleSheetsForStyleSheetList);
info.addMember(m_styleSheetCandidateNodes);
Modified: branches/chromium/1312/Source/WebCore/dom/DocumentStyleSheetCollection.h (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/dom/DocumentStyleSheetCollection.h 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/dom/DocumentStyleSheetCollection.h 2012-12-07 18:07:59 UTC (rev 136960)
@@ -56,6 +56,7 @@
CSSStyleSheet* pageUserSheet();
const Vector<RefPtr<CSSStyleSheet> >& documentUserStyleSheets() const { return m_userStyleSheets; }
+ const Vector<RefPtr<CSSStyleSheet> >& documentAuthorStyleSheets() const { return m_authorStyleSheets; }
const Vector<RefPtr<CSSStyleSheet> >& injectedUserStyleSheets() const;
const Vector<RefPtr<CSSStyleSheet> >& injectedAuthorStyleSheets() const;
@@ -67,6 +68,7 @@
void invalidateInjectedStyleSheetCache();
void updateInjectedStyleSheetCache() const;
+ void addAuthorSheet(PassRefPtr<StyleSheetContents> authorSheet);
void addUserSheet(PassRefPtr<StyleSheetContents> userSheet);
bool needsUpdateActiveStylesheetsOnStyleRecalc() const { return m_needsUpdateActiveStylesheetsOnStyleRecalc; }
@@ -132,6 +134,7 @@
mutable bool m_injectedStyleSheetCacheValid;
Vector<RefPtr<CSSStyleSheet> > m_userStyleSheets;
+ Vector<RefPtr<CSSStyleSheet> > m_authorStyleSheets;
bool m_hadActiveLoadingStylesheet;
bool m_needsUpdateActiveStylesheetsOnStyleRecalc;
Modified: branches/chromium/1312/Source/WebCore/testing/Internals.cpp (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/testing/Internals.cpp 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/testing/Internals.cpp 2012-12-07 18:07:59 UTC (rev 136960)
@@ -71,6 +71,7 @@
#include "Settings.h"
#include "ShadowRoot.h"
#include "SpellChecker.h"
+#include "StyleSheetContents.h"
#include "TextIterator.h"
#include "TreeScope.h"
#include "ViewportArguments.h"
@@ -1281,6 +1282,22 @@
settings()->allowRoundingHacks();
}
+void Internals::insertAuthorCSS(Document* document, const String& css) const
+{
+ RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document);
+ parsedSheet->setIsUserStyleSheet(false);
+ parsedSheet->parseString(css);
+ document->styleSheetCollection()->addAuthorSheet(parsedSheet);
+}
+
+void Internals::insertUserCSS(Document* document, const String& css) const
+{
+ RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document);
+ parsedSheet->setIsUserStyleSheet(true);
+ parsedSheet->parseString(css);
+ document->styleSheetCollection()->addUserSheet(parsedSheet);
+}
+
String Internals::counterValue(Element* element)
{
if (!element)
Modified: branches/chromium/1312/Source/WebCore/testing/Internals.h (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/testing/Internals.h 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/testing/Internals.h 2012-12-07 18:07:59 UTC (rev 136960)
@@ -200,6 +200,9 @@
void allowRoundingHacks() const;
+ void insertAuthorCSS(Document*, const String&) const;
+ void insertUserCSS(Document*, const String&) const;
+
#if ENABLE(INSPECTOR)
unsigned numberOfLiveNodes() const;
unsigned numberOfLiveDocuments() const;
Modified: branches/chromium/1312/Source/WebCore/testing/Internals.idl (136959 => 136960)
--- branches/chromium/1312/Source/WebCore/testing/Internals.idl 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebCore/testing/Internals.idl 2012-12-07 18:07:59 UTC (rev 136960)
@@ -160,6 +160,9 @@
void allowRoundingHacks();
+ void insertAuthorCSS(in Document document, in DOMString css);
+ void insertUserCSS(in Document document, in DOMString css);
+
#if defined(ENABLE_BATTERY_STATUS) && ENABLE_BATTERY_STATUS
void setBatteryStatus(in Document document, in DOMString eventType, in boolean charging, in double chargingTime, in double dischargingTime, in double level) raises (DOMException);
#endif
Modified: branches/chromium/1312/Source/WebKit/chromium/ChangeLog (136959 => 136960)
--- branches/chromium/1312/Source/WebKit/chromium/ChangeLog 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebKit/chromium/ChangeLog 2012-12-07 18:07:59 UTC (rev 136960)
@@ -1,5 +1,15 @@
-2012-11-19 Yusuke Sato <yusu...@chromium.org>
+2012-12-06 Tony Chang <t...@chromium.org>
+ REGRESSION(r135082): Restore the ability to insert author level style sheets from script
+ https://bugs.webkit.org/show_bug.cgi?id=104042
+
+ Reviewed by Antti Koivisto.
+
+ * src/WebDocument.cpp:
+ (WebKit::WebDocument::insertUserStyleSheet): Use addAuthorSheet if an author level script is requested.
+
+2012-12-06 Sadrul Habib Chowdhury <sad...@chromium.org>
+
[Chromium] Flash cannot receive scroll events when threaded compositing is in use
https://bugs.webkit.org/show_bug.cgi?id=101423
Modified: branches/chromium/1312/Source/WebKit/chromium/src/WebDocument.cpp (136959 => 136960)
--- branches/chromium/1312/Source/WebKit/chromium/src/WebDocument.cpp 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebKit/chromium/src/WebDocument.cpp 2012-12-07 18:07:59 UTC (rev 136960)
@@ -194,15 +194,17 @@
return WebDocumentType(constUnwrap<Document>()->doctype());
}
-void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLevel)
+void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLevel styleLevel)
{
RefPtr<Document> document = unwrap<Document>();
- // FIXME: We currently ignore the passed in UserStyleLevel. http://crbug.com/162096
RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document.get());
- parsedSheet->setIsUserStyleSheet(true);
+ parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel);
parsedSheet->parseString(sourceCode);
- document->styleSheetCollection()->addUserSheet(parsedSheet.release());
+ if (parsedSheet->isUserStyleSheet())
+ document->styleSheetCollection()->addUserSheet(parsedSheet);
+ else
+ document->styleSheetCollection()->addAuthorSheet(parsedSheet);
}
void WebDocument::cancelFullScreen()
Modified: branches/chromium/1312/Source/WebKit2/ChangeLog (136959 => 136960)
--- branches/chromium/1312/Source/WebKit2/ChangeLog 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/WebKit2/ChangeLog 2012-12-07 18:07:59 UTC (rev 136960)
@@ -1,3 +1,14 @@
+2012-12-06 Tony Chang <t...@chromium.org>
+
+ REGRESSION(r135082): Restore the ability to insert author level style sheets from script
+ https://bugs.webkit.org/show_bug.cgi?id=104042
+
+ Reviewed by Antti Koivisto.
+
+ Update exports for Internals.cpp.
+
+ * win/WebKit2.def.in:
+
2012-10-29 Michael Saboff <msab...@apple.com>
WKStringCopyCFString() should directly use 8 bit Strings data instead of up converting
Modified: branches/chromium/1312/Source/autotools/symbols.filter (136959 => 136960)
--- branches/chromium/1312/Source/autotools/symbols.filter 2012-12-07 17:54:54 UTC (rev 136959)
+++ branches/chromium/1312/Source/autotools/symbols.filter 2012-12-07 18:07:59 UTC (rev 136960)
@@ -206,6 +206,13 @@
_ZNK7WebCore9DOMWindow8documentEv;
_ZTVN7WebCore28InspectorFrontendClientLocal8SettingsE;
_ZNK7WebCore5Frame15layerTreeAsTextEj;
+_ZN7WebCore16CSSParserContextC1EPNS_8DocumentERKNS_4KURLERKN3WTF6StringE;
+_ZN7WebCore18StyleSheetContents11parseStringERKN3WTF6StringE;
+_ZN7WebCore18StyleSheetContentsC1EPNS_15StyleRuleImportERKN3WTF6StringERKNS_16CSSParserContextE;
+_ZN7WebCore18StyleSheetContentsD1Ev;
+_ZN7WebCore28DocumentStyleSheetCollection12addUserSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE;
+_ZN7WebCore28DocumentStyleSheetCollection14addAuthorSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE;
+_ZN7WebCore4KURL10invalidateEv;
local:
_Z*;