Title: [210756] trunk/Source/WebInspectorUI
Revision
210756
Author
nvasil...@apple.com
Date
2017-01-13 19:07:31 -0800 (Fri, 13 Jan 2017)

Log Message

Web Inspector: the 'lock' icon for non-editable rules in the Style Rules sidebar lacks a tooltip
https://bugs.webkit.org/show_bug.cgi?id=166909
<rdar://problem/29959406>

Reviewed by Matt Baker.

Convert the lock icon from a pseudo-element to an 'img' element and add a title attribute.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/CSSStyleDeclarationSection.css:
(.style-declaration-section.locked > .header > .locked-icon):
(.style-declaration-section.locked > .header::before): Deleted.
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (210755 => 210756)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-01-14 02:53:57 UTC (rev 210755)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-01-14 03:07:31 UTC (rev 210756)
@@ -1,3 +1,20 @@
+2017-01-13  Nikita Vasilyev  <nvasil...@apple.com>
+
+        Web Inspector: the 'lock' icon for non-editable rules in the Style Rules sidebar lacks a tooltip
+        https://bugs.webkit.org/show_bug.cgi?id=166909
+        <rdar://problem/29959406>
+
+        Reviewed by Matt Baker.
+
+        Convert the lock icon from a pseudo-element to an 'img' element and add a title attribute.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Views/CSSStyleDeclarationSection.css:
+        (.style-declaration-section.locked > .header > .locked-icon):
+        (.style-declaration-section.locked > .header::before): Deleted.
+        * UserInterface/Views/CSSStyleDeclarationSection.js:
+        (WebInspector.CSSStyleDeclarationSection):
+
 2017-01-12  Nikita Vasilyev  <nvasil...@apple.com>
 
         REGRESSION (r209711): Web Inspector: in Elements Tab, selecting a deeply nested DOM element causes navigation bar buttons to be pushed off the leading edge

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (210755 => 210756)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2017-01-14 02:53:57 UTC (rev 210755)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2017-01-14 03:07:31 UTC (rev 210756)
@@ -38,6 +38,7 @@
 localizedStrings["%s Prototype"] = "%s Prototype";
 localizedStrings["%s \u2013 %s"] = "%s \u2013 %s";
 localizedStrings["%s \u2014 %s"] = "%s \u2014 %s";
+localizedStrings["%s cannot be modified"] = "%s cannot be modified";
 localizedStrings["%s delay"] = "%s delay";
 localizedStrings["%s interval"] = "%s interval";
 localizedStrings["(Index)"] = "(Index)";
@@ -746,6 +747,7 @@
 localizedStrings["Style"] = "Style";
 localizedStrings["Style Attribute"] = "Style Attribute";
 localizedStrings["Style Rules"] = "Style Rules";
+localizedStrings["Style rule"] = "Style rule";
 localizedStrings["Styles"] = "Styles";
 localizedStrings["Styles Invalidated"] = "Styles Invalidated";
 localizedStrings["Styles Recalculated"] = "Styles Recalculated";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css (210755 => 210756)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css	2017-01-14 02:53:57 UTC (rev 210755)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css	2017-01-14 03:07:31 UTC (rev 210756)
@@ -60,16 +60,12 @@
     line-height: 12px;
 }
 
-.style-declaration-section.locked > .header::before {
+.style-declaration-section.locked > .header > .locked-icon {
     float: right;
     width: 8px;
     height: 10px;
     margin-left: 5px;
-    content: "";
-    background-image: url(../Images/Locked.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    background-size: 8px 10px;
+    content: url(../Images/Locked.svg);
 }
 
 .style-declaration-section > .header > .icon {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js (210755 => 210756)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js	2017-01-14 02:53:57 UTC (rev 210755)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js	2017-01-14 03:07:31 UTC (rev 210756)
@@ -47,6 +47,18 @@
         this._headerElement = document.createElement("div");
         this._headerElement.classList.add("header");
 
+        if (!style.editable) {
+            let lockedIconElement = this._headerElement.createChild("img", "locked-icon");
+
+            let styleLabel;
+            if (style.ownerRule && style.ownerRule.type === WebInspector.CSSStyleSheet.Type.UserAgent)
+                styleLabel = WebInspector.UIString("User Agent Stylesheet");
+            else
+                styleLabel = WebInspector.UIString("Style rule");
+
+            lockedIconElement.title = WebInspector.UIString("%s cannot be modified").format(styleLabel);
+        }
+
         this._iconElement = this._headerElement.createChild("img", "icon");
 
         if (this.selectorEditable) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to