Bug 11366: Web Inspector should show user agent style rules
http://bugs.webkit.org/show_bug.cgi?id=11366
* WebInspector/WebInspector.m:
(-[WebInspector init]):
(-[WebInspector showOptionsMenu]):
(-[WebInspector _toggleShowUserAgentStyles:]):
* WebInspector/WebInspectorInternal.h:
* WebInspector/webInspector/inspector.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17150
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-19 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Anders.
+
+ Bug 11366: Web Inspector should show user agent style rules
+ http://bugs.webkit.org/show_bug.cgi?id=11366
+
+ * WebInspector/WebInspector.m:
+ (-[WebInspector init]):
+ (-[WebInspector showOptionsMenu]):
+ (-[WebInspector _toggleShowUserAgentStyles:]):
+ * WebInspector/WebInspectorInternal.h:
+ * WebInspector/webInspector/inspector.js:
+
2006-10-19 Brady Eidson <beidson@apple.com>
Build fix - 2gig is on that pesky signed/unsigned limit...
_private = [[WebInspectorPrivate alloc] init];
_private->ignoreWhitespace = YES;
+ _private->showUserAgentStyles = YES;
return self;
}
[item setState:_private->ignoreWhitespace];
[menu addItem:item];
+ item = [[[NSMenuItem alloc] init] autorelease];
+ [item setTitle:@"Show User Agent Styles"];
+ [item setTarget:self];
+ [item setAction:@selector(_toggleShowUserAgentStyles:)];
+ [item setState:_private->showUserAgentStyles];
+ [menu addItem:item];
+
[NSMenu popUpContextMenu:menu withEvent:[[self window] currentEvent] forView:_private->webView];
[menu release];
[self _updateTreeScrollbar];
}
+- (IBAction)_toggleShowUserAgentStyles:(id)sender
+{
+ _private->showUserAgentStyles = !_private->showUserAgentStyles;
+ if (_private->webViewLoaded)
+ [[_private->webView windowScriptObject] evaluateWebScript:@"toggleShowUserAgentStyles()"];
+}
+
- (void)_highlightNode:(DOMNode *)node
{
if (_private->currentHighlight) {
NSImage *rightArrowImage;
NSImage *downArrowImage;
BOOL ignoreWhitespace;
+ BOOL showUserAgentStyles;
BOOL webViewLoaded;
BOOL searchResultsVisible;
BOOL preventHighlight;
*/
var Inspector = null;
+var showUserAgentStyles = true;
// Property values to omit in the computed style list.
// If a property has this value, it will be omitted.
}
}
- var matchedStyleRules = focusedNode.ownerDocument.defaultView.getMatchedCSSRules(focusedNode, "");
+ var matchedStyleRules = focusedNode.ownerDocument.defaultView.getMatchedCSSRules(focusedNode, "", !showUserAgentStyles);
if (matchedStyleRules) {
for (var i = 0; i < matchedStyleRules.length; i++) {
styleRules.push(matchedStyleRules[i]);
sheet = styleRules[i].subtitle;
else if (styleRules[i].parentStyleSheet && styleRules[i].parentStyleSheet.href)
sheet = styleRules[i].parentStyleSheet.href;
+ else if (styleRules[i].parentStyleSheet && !styleRules[i].parentStyleSheet.ownerNode)
+ sheet = "user agent stylesheet";
else
sheet = "inline stylesheet";
cell.textContent = sheet;
stylePropertiesScrollArea.refresh();
}
+function toggleShowUserAgentStyles()
+{
+ showUserAgentStyles = !showUserAgentStyles;
+ updateStylePane();
+}
+
function selectMappedStyleRule(attrName)
{
if (!paneUpdateState["style"])