Reviewed by Dave Hyatt.
<rdar://problem/
5569233> Add the ability to disable author and user CSS styles
* WebCore.base.exp: Add the Settings::setAuthorAndUserStylesEnabled symbol.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::CSSStyleSelector): Add a new matchAuthorAndUserStyles parameter.
(WebCore::CSSStyleSelector::styleForElement): Check m_matchAuthorAndUserStyles before
matching user and author rules.
(WebCore::CSSStyleSelector::pseudoStyleForElement): Ditto.
(WebCore::CSSStyleSelector::styleRulesForElement): Ditto.
* css/CSSStyleSelector.h: Add m_matchAuthorAndUserStyles and new constructor parameter.
* dom/Document.cpp:
(WebCore::Document::Document): Pass Settings::authorAndUserStylesEnabled to the CSSStyleSelector.
(WebCore::Document::recalcStyleSelector): Skip collecting the author stylesheets if
Settings::authorAndUserStylesEnabled is false, and pass that to the CSSStyleSelector.
* page/Settings.cpp:
(WebCore::Settings::Settings): Initialize m_authorAndUserStylesEnabled to true.
(WebCore::Settings::setAuthorAndUserStylesEnabled): Recalc style in all the frames
when the setting changes.
* page/Settings.h: Add m_authorAndUserStylesEnabled.
(WebCore::Settings::authorAndUserStylesEnabled): Return m_authorAndUserStylesEnabled.
WebKit/mac:
Reviewed by Dave Hyatt.
<rdar://problem/
5569233> Add the ability to disable author and user CSS styles
* WebView/WebPreferenceKeysPrivate.h: Define WebKitRespectStandardStyleKeyEquivalentsPreferenceKey.
* WebView/WebPreferences.m:
(+[WebPreferences initialize]): Default WebKitRespectStandardStyleKeyEquivalentsPreferenceKey to YES.
(-[WebPreferences authorAndUserStylesEnabled]): Return the setting's BOOL value.
(-[WebPreferences setAuthorAndUserStylesEnabled:]): Set the setting's BOOL value.
* WebView/WebPreferencesPrivate.h: Add authorAndUserStylesEnabled and setAuthorAndUserStylesEnabled:.
* WebView/WebView.mm:
(-[WebView _preferencesChangedNotification:]): Update WebCore::Settings::authorAndUserStylesEnabled.
WebKitTools:
Reviewed by Dave Hyatt.
<rdar://problem/
5569233> Add the ability to disable author and user CSS styles
Add support for disabling author and user styles for testing.
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/LayoutTestController.cpp:
(setAuthorAndUserStylesEnabledCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::setAuthorAndUserStylesEnabled):
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::setAuthorAndUserStylesEnabled):
LayoutTests:
Reviewed by Dave Hyatt.
Test for: <rdar://problem/
5569233> Add the ability to disable author and user CSS styles
* fast/css/disabled-author-styles.html: Added.
* platform/mac/fast/css/disabled-author-styles-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28071
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-26 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Test for: <rdar://problem/5569233> Add the ability to disable author and user CSS styles
+
+ * fast/css/disabled-author-styles.html: Added.
+ * platform/mac/fast/css/disabled-author-styles-expected.txt: Added.
+
2007-11-26 Feng Qian <ian.eng.webkit@gmail.com>
Reviewed by Sam Weinig.
--- /dev/null
+<html>
+<head>
+ <script>
+ function loaded()
+ {
+ if (!window.layoutTestController) {
+ alert("This test must be run in the DumpRenderTree to work.");
+ return;
+ }
+
+ layoutTestController.setAuthorAndUserStylesEnabled(false);
+
+ // Check the matched rules after a timeout to give time for WebPreferences to update WebCore::Settings.
+ setTimeout(checkMatchedRules, 0);
+ }
+
+ function checkMatchedRules()
+ {
+ var matchedRules = getMatchedCSSRules(document.getElementById("test"), "", true);
+ if (matchedRules && matchedRules.length)
+ alert(matchedRules.length + " rule(s) were returned from getMatchedCSSRules, expected zero.");
+ }
+ </script>
+ <style>
+ #test {
+ color: red;
+ }
+
+ #test2::before {
+ color: red;
+ content: "This pseudo-element text should not show up.";
+ }
+ </style>
+</head>
+<body onload="loaded();">
+ <div id="test">This text should be black, not red.</div>
+ <div id="test2"></div>
+</body>
+</html>
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 214x18
+ text run at (0,0) width 214: "This text should be black, not red."
+ RenderBlock {DIV} at (0,18) size 784x0
# fireKeyboardEventsToElement is not implemented in DRT <rdar://problem/5137198>
fast/events/objc-keyboard-event-creation.html
+# setAuthorAndUserStylesEnabled is not implemented in DRT <rdar://problem/5614497>
+fast/css/disabled-author-styles.html
+
# The eqqivalent of option-tab doesn not exist in Boomer <rdar://problem/5137230>
fast/events/frame-tab-focus.html
fast/events/option-tab.html
+2007-11-26 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ <rdar://problem/5569233> Add the ability to disable author and user CSS styles
+
+ * WebCore.base.exp: Add the Settings::setAuthorAndUserStylesEnabled symbol.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::CSSStyleSelector): Add a new matchAuthorAndUserStyles parameter.
+ (WebCore::CSSStyleSelector::styleForElement): Check m_matchAuthorAndUserStyles before
+ matching user and author rules.
+ (WebCore::CSSStyleSelector::pseudoStyleForElement): Ditto.
+ (WebCore::CSSStyleSelector::styleRulesForElement): Ditto.
+ * css/CSSStyleSelector.h: Add m_matchAuthorAndUserStyles and new constructor parameter.
+ * dom/Document.cpp:
+ (WebCore::Document::Document): Pass Settings::authorAndUserStylesEnabled to the CSSStyleSelector.
+ (WebCore::Document::recalcStyleSelector): Skip collecting the author stylesheets if
+ Settings::authorAndUserStylesEnabled is false, and pass that to the CSSStyleSelector.
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings): Initialize m_authorAndUserStylesEnabled to true.
+ (WebCore::Settings::setAuthorAndUserStylesEnabled): Recalc style in all the frames
+ when the setting changes.
+ * page/Settings.h: Add m_authorAndUserStylesEnabled.
+ (WebCore::Settings::authorAndUserStylesEnabled): Return m_authorAndUserStylesEnabled.
+
2007-11-27 Alp Toker <alp@atoker.com>
Reviewed by Mark Rowe.
__ZN7WebCore8Settings27setFTPDirectoryTemplatePathERKNS_6StringE
__ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
__ZN7WebCore8Settings28setForceFTPDirectoryListingsEb
+__ZN7WebCore8Settings29setAuthorAndUserStylesEnabledEb
__ZN7WebCore8Settings29setDefaultDatabaseOriginQuotaEy
__ZN7WebCore8Settings31setShrinksStandaloneImagesToFitEb
__ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
+ compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
static CSSStyleSelector::Encodedurl *currentEncodedURL = 0;
static PseudoState pseudoState;
-CSSStyleSelector::CSSStyleSelector(Document* doc, const String& userStyleSheet, StyleSheetList *styleSheets, CSSStyleSheet* mappedElementSheet, bool _strictParsing)
+CSSStyleSelector::CSSStyleSelector(Document* doc, const String& userStyleSheet, StyleSheetList *styleSheets, CSSStyleSheet* mappedElementSheet, bool _strictParsing, bool matchAuthorAndUserStyles)
{
init();
m_document = doc;
+ m_matchAuthorAndUserStyles = matchAuthorAndUserStyles;
+
strictParsing = _strictParsing;
if (!defaultStyle)
loadDefaultStyle();
if (!resolveForRootDefault) {
// 4. Now we check user sheet rules.
- matchRules(m_userStyle, firstUserRule, lastUserRule);
+ if (m_matchAuthorAndUserStyles)
+ matchRules(m_userStyle, firstUserRule, lastUserRule);
// 5. Now check author rules, beginning first with presentational attributes
// mapped from HTML.
}
// 6. Check the rules in author sheets next.
- matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
-
+ if (m_matchAuthorAndUserStyles)
+ matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
+
// 7. Now check our inline style attribute.
- if (styledElement) {
+ if (m_matchAuthorAndUserStyles && styledElement) {
CSSMutableStyleDeclaration* inlineDecl = styledElement->inlineStyleDecl();
if (inlineDecl) {
lastAuthorRule = m_matchedDecls.size();
// Check UA, user and author rules.
int firstUARule = -1, lastUARule = -1, firstUserRule = -1, lastUserRule = -1, firstAuthorRule = -1, lastAuthorRule = -1;
matchUARules(firstUARule, lastUARule);
- matchRules(m_userStyle, firstUserRule, lastUserRule);
- matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
-
+
+ if (m_matchAuthorAndUserStyles) {
+ matchRules(m_userStyle, firstUserRule, lastUserRule);
+ matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
+ }
+
if (m_matchedDecls.isEmpty())
return 0;
matchUARules(firstUARule, lastUARule);
// Now we check user sheet rules.
- int firstUserRule = -1, lastUserRule = -1;
- matchRules(m_userStyle, firstUserRule, lastUserRule);
+ if (m_matchAuthorAndUserStyles) {
+ int firstUserRule = -1, lastUserRule = -1;
+ matchRules(m_userStyle, firstUserRule, lastUserRule);
+ }
+ }
+
+ if (m_matchAuthorAndUserStyles) {
+ // Check the rules in author sheets.
+ int firstAuthorRule = -1, lastAuthorRule = -1;
+ matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
}
- // Check the rules in author sheets.
- int firstAuthorRule = -1, lastAuthorRule = -1;
- matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
-
m_collectRulesOnly = false;
return m_ruleList;
class CSSStyleSelector : public StyleSelector
{
public:
- CSSStyleSelector(Document*, const String& userStyleSheet, StyleSheetList *styleSheets, CSSStyleSheet* mappedElementsSheet, bool strictParsing);
+ CSSStyleSelector(Document*, const String& userStyleSheet, StyleSheetList *styleSheets, CSSStyleSheet* mappedElementsSheet, bool strictParsing, bool matchAuthorAndUserStyles);
~CSSStyleSelector();
static void loadDefaultStyle();
CSSValue* m_lineHeightValue;
bool fontDirty;
bool isXMLDoc;
-
+ bool m_matchAuthorAndUserStyles;
+
RefPtr<CSSFontSelector> m_fontSelector;
HashSet<AtomicStringImpl*> m_selectorAttrs;
m_usesFirstLetterRules = false;
m_gotoAnchorNeededAfterStylesheetsLoad = false;
- m_styleSelector = new CSSStyleSelector(this, m_usersheet, m_styleSheets.get(), m_mappedElementSheet.get(), !inCompatMode());
+ bool matchAuthorAndUserStyles = true;
+ if (Settings* settings = this->settings())
+ matchAuthorAndUserStyles = settings->authorAndUserStylesEnabled();
+ m_styleSelector = new CSSStyleSelector(this, m_usersheet, m_styleSheets.get(), m_mappedElementSheet.get(), !inCompatMode(), matchAuthorAndUserStyles);
+
m_didCalculateStyleSelector = false;
m_pendingStylesheets = 0;
m_ignorePendingStylesheets = false;
DeprecatedPtrList<StyleSheet> oldStyleSheets = m_styleSheets->styleSheets;
m_styleSheets->styleSheets.clear();
- Node *n;
- for (n = this; n; n = n->traverseNextNode()) {
- StyleSheet *sheet = 0;
- if (n->nodeType() == PROCESSING_INSTRUCTION_NODE)
- {
+ bool matchAuthorAndUserStyles = true;
+ if (Settings* settings = this->settings())
+ matchAuthorAndUserStyles = settings->authorAndUserStylesEnabled();
+
+ Node* n = matchAuthorAndUserStyles ? this : 0;
+ for ( ; n; n = n->traverseNextNode()) {
+ StyleSheet* sheet = 0;
+
+ if (n->nodeType() == PROCESSING_INSTRUCTION_NODE) {
// Processing instruction (XML documents only)
ProcessingInstruction* pi = static_cast<ProcessingInstruction*>(n);
sheet = pi->sheet();
return;
}
#endif
- if (!sheet && !pi->localHref().isEmpty())
- {
+ if (!sheet && !pi->localHref().isEmpty()) {
// Processing instruction with reference to an element in this document - e.g.
// <?xml-stylesheet href="#mystyle">, with the element
// <foo id="mystyle">heading { color: red; }</foo> at some location in
Element* elem = getElementById(pi->localHref().impl());
if (elem) {
String sheetText("");
- Node *c;
- for (c = elem->firstChild(); c; c = c->nextSibling()) {
+ for (Node* c = elem->firstChild(); c; c = c->nextSibling()) {
if (c->nodeType() == TEXT_NODE || c->nodeType() == CDATA_SECTION_NODE)
sheetText += c->nodeValue();
}
- CSSStyleSheet *cssSheet = new CSSStyleSheet(this);
+ CSSStyleSheet* cssSheet = new CSSStyleSheet(this);
cssSheet->parseString(sheetText);
pi->setCSSStyleSheet(cssSheet);
sheet = cssSheet;
}
}
-
} else if (n->isHTMLElement() && (n->hasTagName(linkTag) || n->hasTagName(styleTag))
#if ENABLE(SVG)
|| (n->isSVGElement() && n->hasTagName(SVGNames::styleTag))
if (e->hasLocalName(styleTag) || !rel.contains("alternate"))
m_preferredStylesheetSet = m_selectedStylesheetSet = title;
}
-
+
if (title != m_preferredStylesheetSet)
sheet = 0;
sheet->ref();
m_styleSheets->styleSheets.append(sheet);
}
-
+
// For HTML documents, stylesheets are not allowed within/after the <BODY> tag. So we
// can stop searching here.
if (isHTMLDocument() && n->hasTagName(bodyTag))
String usersheet = m_usersheet;
if (view() && view()->mediaType() == "print")
usersheet += m_printSheet;
- m_styleSelector = new CSSStyleSelector(this, usersheet, m_styleSheets.get(), m_mappedElementSheet.get(), !inCompatMode());
+ m_styleSelector = new CSSStyleSelector(this, usersheet, m_styleSheets.get(), m_mappedElementSheet.get(), !inCompatMode(), matchAuthorAndUserStyles);
m_styleSelector->setEncodedURL(m_url);
m_didCalculateStyleSelector = true;
}
, m_showsURLsInToolTips(false)
, m_forceFTPDirectoryListings(false)
, m_developerExtrasEnabled(false)
+ , m_authorAndUserStylesEnabled(true)
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
m_developerExtrasEnabled = developerExtrasEnabled;
}
+void Settings::setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled)
+{
+ m_authorAndUserStylesEnabled = authorAndUserStylesEnabled;
+ setNeedsReapplyStylesInAllFrames(m_page);
+}
+
void Settings::setDefaultDatabaseOriginQuota(unsigned long long quota)
{
DatabaseTracker::tracker().setDefaultOriginQuota(quota);
return DatabaseTracker::tracker().defaultOriginQuota();
}
-
} // namespace WebCore
void setDeveloperExtrasEnabled(bool);
bool developerExtrasEnabled() const { return m_developerExtrasEnabled; }
+ void setAuthorAndUserStylesEnabled(bool);
+ bool authorAndUserStylesEnabled() const { return m_authorAndUserStylesEnabled; }
+
void setDefaultDatabaseOriginQuota(unsigned long long);
unsigned long long defaultDatabaseOriginQuota() const;
bool m_showsURLsInToolTips : 1;
bool m_forceFTPDirectoryListings : 1;
bool m_developerExtrasEnabled : 1;
+ bool m_authorAndUserStylesEnabled : 1;
};
} // namespace WebCore
+2007-11-26 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ <rdar://problem/5569233> Add the ability to disable author and user CSS styles
+
+ * WebView/WebPreferenceKeysPrivate.h: Define WebKitRespectStandardStyleKeyEquivalentsPreferenceKey.
+ * WebView/WebPreferences.m:
+ (+[WebPreferences initialize]): Default WebKitRespectStandardStyleKeyEquivalentsPreferenceKey to YES.
+ (-[WebPreferences authorAndUserStylesEnabled]): Return the setting's BOOL value.
+ (-[WebPreferences setAuthorAndUserStylesEnabled:]): Set the setting's BOOL value.
+ * WebView/WebPreferencesPrivate.h: Add authorAndUserStylesEnabled and setAuthorAndUserStylesEnabled:.
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Update WebCore::Settings::authorAndUserStylesEnabled.
+
2007-11-26 Brady Eidson <beidson@apple.com>
Reviewed by Mark Rowe
[preferences setAutosaves:NO];
[preferences setPrivateBrowsingEnabled:YES];
[preferences setLoadsImagesAutomatically:YES];
+ [preferences setAuthorAndUserStylesEnabled:YES];
[preferences setJavaScriptEnabled:YES];
[preferences setAllowsAnimatedImages:YES];
[preferences setLoadsImagesAutomatically:YES];
#define WebKitFTPDirectoryTemplatePath @"WebKitFTPDirectoryTemplatePath"
#define WebKitForceFTPDirectoryListings @"WebKitForceFTPDirectoryListings"
#define WebKitDeveloperExtrasEnabledPreferenceKey @"WebKitDeveloperExtrasEnabledPreferenceKey"
+#define WebKitAuthorAndUserStylesEnabledPreferenceKey @"WebKitAuthorAndUserStylesEnabledPreferenceKey"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
[NSNumber numberWithBool:YES], WebKitUsesPageCachePreferenceKey,
[NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
[NSNumber numberWithBool:NO], WebKitDeveloperExtrasEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitAuthorAndUserStylesEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
[self _setBoolValue:flag forKey:WebKitDeveloperExtrasEnabledPreferenceKey];
}
+- (BOOL)authorAndUserStylesEnabled
+{
+ return [self _boolValueForKey:WebKitAuthorAndUserStylesEnabledPreferenceKey];
+}
+
+- (void)setAuthorAndUserStylesEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitAuthorAndUserStylesEnabledPreferenceKey];
+}
+
- (BOOL)respectStandardStyleKeyEquivalents
{
return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
- (BOOL)developerExtrasEnabled;
- (void)setDeveloperExtrasEnabled:(BOOL)flag;
+- (BOOL)authorAndUserStylesEnabled;
+- (void)setAuthorAndUserStylesEnabled:(BOOL)flag;
+
- (BOOL)respectStandardStyleKeyEquivalents;
- (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag;
settings->setUsesPageCache([self usesPageCache]);
settings->setShowsURLsInToolTips([preferences showsURLsInToolTips]);
settings->setDeveloperExtrasEnabled([preferences developerExtrasEnabled]);
+ settings->setAuthorAndUserStylesEnabled([preferences authorAndUserStylesEnabled]);
if ([preferences userStyleSheetEnabled]) {
NSString* location = [[preferences userStyleSheetLocation] _web_originalDataAsString];
settings->setUserStyleSheetLocation([NSURL URLWithString:(location ? location : @"")]);
+2007-11-27 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ <rdar://problem/5569233> Add the ability to disable author and user CSS styles
+
+ Add support for disabling author and user styles for testing.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setAuthorAndUserStylesEnabledCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setAuthorAndUserStylesEnabled):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setAuthorAndUserStylesEnabled):
+
2007-11-26 Dan Bernstein <mitz@apple.com>
- Tiger build fix.
A8B91BF70CF522B4008F91FF /* CheckedMalloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckedMalloc.cpp; path = mac/CheckedMalloc.cpp; sourceTree = "<group>"; };
A8B91BF80CF522B4008F91FF /* JavaScriptThreading.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaScriptThreading.cpp; path = mac/JavaScriptThreading.cpp; sourceTree = "<group>"; };
A8B91BF90CF522B4008F91FF /* CheckedMalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CheckedMalloc.h; path = mac/CheckedMalloc.h; sourceTree = "<group>"; };
- AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; name = AHEM____.TTF; path = qt/fonts/AHEM____.TTF; sourceTree = "<group>"; };
+ AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; name = "AHEM____.TTF"; path = "qt/fonts/AHEM____.TTF"; sourceTree = "<group>"; };
AE8257EF08D22389000507AB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
B5A7526708AF4A4A00138E45 /* ImageDiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageDiff; sourceTree = BUILT_PRODUCTS_DIR; };
B5A752A108AF5D1F00138E45 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C29C308902C6D008A9EFC /* Build configuration list for PBXProject "DumpRenderTree" */;
+ compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* DumpRenderTree */;
productRefGroup = 9340995508540CAF007F3BC8 /* Products */;
return JSValueMakeUndefined(context);
}
+static JSValueRef setAuthorAndUserStylesEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setAuthorAndUserStylesEnabled(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setCustomPolicyDelegateCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation
{ "queueScript", queueScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "repaintSweepHorizontally", repaintSweepHorizontallyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAcceptsEditing", setAcceptsEditingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setAuthorAndUserStylesEnabled", setAuthorAndUserStylesEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setCallCloseOnWebViews", setCallCloseOnWebViewsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setCanOpenWindows", setCanOpenWindowsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setCloseRemainingWindowsWhenComplete", setCloseRemainingWindowsWhenCompleteCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
void queueReload();
void queueScript(JSStringRef url);
void setAcceptsEditing(bool acceptsEditing);
+ void setAuthorAndUserStylesEnabled(bool);
void setCustomPolicyDelegate(bool setDelegate);
void setMainFrameIsFirstResponder(bool flag);
void setPrivateBrowsingEnabled(bool flag);
#import <WebKit/WebHistory.h>
#import <WebKit/WebNSURLExtras.h>
#import <WebKit/WebPreferences.h>
+#import <WebKit/WebPreferencesPrivate.h>
#import <WebKit/WebView.h>
#import <WebKit/WebViewPrivate.h>
#import <wtf/RetainPtr.h>
[(EditingDelegate *)[[mainFrame webView] editingDelegate] setAcceptsEditing:newAcceptsEditing];
}
+void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
+{
+ [[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag];
+}
+
void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)
{
if (setDelegate)
editingDelegate->setAcceptsEditing(acceptsEditing);
}
+void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
+{
+ // FIXME: Implement!
+}
+
void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)
{
COMPtr<IWebView> webView;