Changeset 270637 in webkit
- Timestamp:
- Dec 10, 2020 11:09:00 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 8 added
- 23 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/css/getComputedPrimaryFontForNode-expected.txt (added)
-
LayoutTests/inspector/css/getComputedPrimaryFontForNode.html (added)
-
LayoutTests/inspector/model/font-calculate-properties-expected.txt (added)
-
LayoutTests/inspector/model/font-calculate-properties.html (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/inspector/protocol/CSS.json (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (modified) (3 diffs)
-
Source/WebCore/inspector/agents/InspectorCSSAgent.h (modified) (2 diffs)
-
Source/WebCore/platform/graphics/FontPlatformData.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/FontPlatformData.h (modified) (3 diffs)
-
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (modified) (3 diffs)
-
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h (modified) (2 diffs)
-
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (modified) (2 diffs)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (modified) (39 diffs)
-
Source/WebInspectorUI/UserInterface/Base/Setting.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Main.html (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (modified) (5 diffs)
-
Source/WebInspectorUI/UserInterface/Models/Font.js (added)
-
Source/WebInspectorUI/UserInterface/Models/FontVariationAxis.js (added)
-
Source/WebInspectorUI/UserInterface/Test.html (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.css (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ElementsTabContentView.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/FontDetailsPanel.js (added)
-
Source/WebInspectorUI/UserInterface/Views/FontDetailsSidebarPanel.js (added)
-
Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.css (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js (modified) (6 diffs)
-
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r270635 r270637 1 2020-12-10 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Show current properties for font in new Elements sidebar Font panel 4 https://bugs.webkit.org/show_bug.cgi?id=218964 5 6 Reviewed by Devin Rousso. 7 8 * inspector/css/getComputedPrimaryFontForNode-expected.txt: Added. 9 * inspector/css/getComputedPrimaryFontForNode.html: Added. 10 * inspector/model/font-calculate-properties-expected.txt: Added. 11 * inspector/model/font-calculate-properties.html: Added. 12 1 13 2020-12-10 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/Source/JavaScriptCore/ChangeLog
r270634 r270637 1 2020-12-10 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Show current properties for font in new Elements sidebar Font panel 4 https://bugs.webkit.org/show_bug.cgi?id=218964 5 6 Reviewed by Devin Rousso. 7 8 Adds objects and method for getting font data for a node to the `CSS` domain. A `CSS.Font` is meant to represent 9 a `WebCore::Font` and contain information about the underlying font as the system sees it. The source for this 10 information can be a system font or a web font. Each `CSS.Font` in turn can have some number of 11 `CSS.FontVariationAxis` for its available open-type variation axes. Fonts that don't support these features will 12 have an empty set of axes. 13 14 * inspector/protocol/CSS.json: 15 - Added objects and method for getting font data for a node. 16 1 17 2020-12-10 Don Olmstead <don.olmstead@sony.com> 2 18 -
trunk/Source/JavaScriptCore/inspector/protocol/CSS.json
r262302 r270637 232 232 { "name": "sourceURL", "type": "string", "optional": true, "description": "URL of the document containing the CSS grouping." } 233 233 ] 234 }, 235 { 236 "id": "Font", 237 "type": "object", 238 "description": "A representation of WebCore::Font. Conceptually this is backed by either a font file on disk or from the network.", 239 "properties": [ 240 { "name": "displayName", "type": "string", "description": "The display name defined by the font." }, 241 { "name": "variationAxes", "type": "array", "items": { "$ref": "FontVariationAxis" }, "description": "The variation axes defined by the font." } 242 ] 243 }, 244 { 245 "id": "FontVariationAxis", 246 "type": "object", 247 "description": "A single variation axis associated with a Font.", 248 "properties": [ 249 { "name": "name", "type": "string", "optional": true, "description": "The name, generally human-readable, of the variation axis. Some axes may not provide a human-readable name distiguishable from the tag. This field is ommited when there is no name, or the name matches the tag exactly." }, 250 { "name": "tag", "type": "string", "description": "The four character tag for the variation axis." }, 251 { "name": "minimumValue", "type": "number", "description": "The minimum value that will affect the axis." }, 252 { "name": "maximumValue", "type": "number", "description": "The maximum value that will affect the axis." }, 253 { "name": "defaultValue", "type": "number", "description": "The value that is used for the axis when it is not otherwise controlled." } 254 ] 234 255 } 235 256 ], … … 279 300 }, 280 301 { 302 "name": "getFontDataForNode", 303 "description": "Returns the primary font of the computed font cascade for a DOM node identified by <code>nodeId</code>.", 304 "parameters": [ 305 { "name": "nodeId", "$ref": "DOM.NodeId" } 306 ], 307 "returns": [ 308 { "name": "primaryFont", "$ref": "Font", "description": "Computed primary font for the specified DOM node." } 309 ] 310 }, 311 { 281 312 "name": "getAllStyleSheets", 282 313 "description": "Returns metainfo entries for all known stylesheets.", -
trunk/Source/WebCore/ChangeLog
r270636 r270637 1 2020-12-10 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Show current properties for font in new Elements sidebar Font panel 4 https://bugs.webkit.org/show_bug.cgi?id=218964 5 6 Reviewed by Devin Rousso. 7 8 Test: inspector/css/getComputedPrimaryFontForNode.html 9 10 Adds support for retrieving the primary font computed for a node including the available variation axes of the 11 underlying Font. 12 13 * inspector/agents/InspectorCSSAgent.cpp: 14 (WebCore::buildObjectForFont): 15 (WebCore::InspectorCSSAgent::getFontDataForNode): 16 (WebCore::InspectorCSSAgent::nodeForId): 17 * inspector/agents/InspectorCSSAgent.h: 18 - Added method for retrieving font data for a node. 19 * platform/graphics/FontPlatformData.cpp: 20 (WebCore::FontPlatformData::variationAxes const): 21 - Empty implementation for non-Cocoa platforms. 22 * platform/graphics/FontPlatformData.h: 23 (WebCore::FontPlatformData::FontVariationAxis::FontVariationAxis): 24 (WebCore::FontPlatformData::FontVariationAxis::name const): 25 (WebCore::FontPlatformData::FontVariationAxis::tag const): 26 (WebCore::FontPlatformData::FontVariationAxis::defaultValue const): 27 (WebCore::FontPlatformData::FontVariationAxis::minimumValue const): 28 (WebCore::FontPlatformData::FontVariationAxis::maximumValue const): 29 - Added struct type for font variation axis information. 30 * platform/graphics/cocoa/FontCacheCoreText.cpp: 31 (WebCore::defaultVariationValues): 32 * platform/graphics/cocoa/FontCacheCoreText.h: 33 - Support getting the name of variation axes. 34 * platform/graphics/cocoa/FontPlatformDataCocoa.mm: 35 (WebCore::FontPlatformData::variationAxes const): 36 - Retrieve font variation axes from the underlying font. 37 1 38 2020-12-10 Dean Jackson <dino@apple.com> 2 39 -
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
r266934 r270637 41 41 #include "DOMWindow.h" 42 42 #include "ElementAncestorIterator.h" 43 #include "Font.h" 43 44 #include "FontCache.h" 45 #include "FontCascade.h" 46 #include "FontPlatformData.h" 44 47 #include "Frame.h" 45 48 #include "HTMLHeadElement.h" … … 558 561 } 559 562 563 static Ref<Protocol::CSS::Font> buildObjectForFont(const Font& font) 564 { 565 auto resultVariationAxes = JSON::ArrayOf<Protocol::CSS::FontVariationAxis>::create(); 566 for (auto& variationAxis : font.platformData().variationAxes()) { 567 auto axis = Protocol::CSS::FontVariationAxis::create() 568 .setTag(variationAxis.tag()) 569 .setMinimumValue(variationAxis.minimumValue()) 570 .setMaximumValue(variationAxis.maximumValue()) 571 .setDefaultValue(variationAxis.defaultValue()) 572 .release(); 573 574 if (variationAxis.name().length() && variationAxis.name() != variationAxis.tag()) 575 axis->setName(variationAxis.name()); 576 577 resultVariationAxes->addItem(WTFMove(axis)); 578 } 579 580 return Protocol::CSS::Font::create() 581 .setDisplayName(font.platformData().familyName()) 582 .setVariationAxes(WTFMove(resultVariationAxes)) 583 .release(); 584 } 585 586 Protocol::ErrorStringOr<Ref<Protocol::CSS::Font>> InspectorCSSAgent::getFontDataForNode(Protocol::DOM::NodeId nodeId) 587 { 588 Protocol::ErrorString errorString; 589 auto* node = nodeForId(errorString, nodeId); 590 if (!node) 591 return makeUnexpected(errorString); 592 593 auto* computedStyle = node->computedStyle(); 594 if (!computedStyle) 595 return makeUnexpected("No computed style for node."); 596 597 return buildObjectForFont(computedStyle->fontCascade().primaryFont()); 598 } 599 560 600 Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Protocol::CSS::CSSStyleSheetHeader>>> InspectorCSSAgent::getAllStyleSheets() 561 601 { … … 906 946 } 907 947 948 Node* InspectorCSSAgent::nodeForId(Protocol::ErrorString& errorString, Protocol::DOM::NodeId nodeId) 949 { 950 auto* domAgent = m_instrumentingAgents.persistentDOMAgent(); 951 if (!domAgent) { 952 errorString = "DOM domain must be enabled"_s; 953 return nullptr; 954 } 955 956 return domAgent->assertNode(errorString, nodeId); 957 } 958 908 959 String InspectorCSSAgent::unbindStyleSheet(InspectorStyleSheet* inspectorStyleSheet) 909 960 { -
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.h
r266885 r270637 91 91 Inspector::Protocol::ErrorStringOr<void> disable(); 92 92 Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Inspector::Protocol::CSS::CSSComputedStyleProperty>>> getComputedStyleForNode(Inspector::Protocol::DOM::NodeId); 93 Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::CSS::Font>> getFontDataForNode(Inspector::Protocol::DOM::NodeId); 93 94 Inspector::Protocol::ErrorStringOr<std::tuple<RefPtr<Inspector::Protocol::CSS::CSSStyle> /* inlineStyle */, RefPtr<Inspector::Protocol::CSS::CSSStyle> /* attributesStyle */>> getInlineStylesForNode(Inspector::Protocol::DOM::NodeId); 94 95 Inspector::Protocol::ErrorStringOr<std::tuple<RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::RuleMatch>>, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::PseudoIdMatches>>, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::InheritedStyleEntry>>>> getMatchedStylesForNode(Inspector::Protocol::DOM::NodeId, Optional<bool>&& includePseudo, Optional<bool>&& includeInherited); … … 134 135 InspectorStyleSheetForInlineStyle& asInspectorStyleSheet(StyledElement&); 135 136 Element* elementForId(Inspector::Protocol::ErrorString&, Inspector::Protocol::DOM::NodeId); 137 Node* nodeForId(Inspector::Protocol::ErrorString&, Inspector::Protocol::DOM::NodeId); 136 138 137 139 void collectAllStyleSheets(Vector<InspectorStyleSheet*>&); -
trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp
r270175 r270637 83 83 84 84 #if !USE(CORE_TEXT) && !PLATFORM(WIN) 85 86 85 String FontPlatformData::familyName() const 87 86 { … … 89 88 return { }; 90 89 } 90 #endif 91 91 92 #if !PLATFORM(COCOA) 93 Vector<FontPlatformData::FontVariationAxis> FontPlatformData::variationAxes() const 94 { 95 // FIXME: <webkit.org/b/219614> Not implemented yet. 96 return { }; 97 } 92 98 #endif 93 99 -
trunk/Source/WebCore/platform/graphics/FontPlatformData.h
r267930 r270637 29 29 #include <wtf/Forward.h> 30 30 #include <wtf/RetainPtr.h> 31 #include <wtf/Vector.h> 31 32 32 33 #if PLATFORM(WIN) … … 79 80 public: 80 81 struct CreationData; 82 83 struct FontVariationAxis { 84 FontVariationAxis(const String& name, const String& tag, int defaultValue, int minimumValue, int maximumValue) 85 : m_name(name) 86 , m_tag(tag) 87 , m_defaultValue(defaultValue) 88 , m_minimumValue(minimumValue) 89 , m_maximumValue(maximumValue) 90 { 91 } 92 93 const String& name() const { return m_name; } 94 const String& tag() const { return m_tag; } 95 int defaultValue() const { return m_defaultValue; } 96 int minimumValue() const { return m_minimumValue; } 97 int maximumValue() const { return m_maximumValue; } 98 99 private: 100 const String m_name; 101 const String m_tag; 102 int m_defaultValue; 103 int m_minimumValue; 104 int m_maximumValue; 105 }; 81 106 82 107 FontPlatformData(WTF::HashTableDeletedValueType); … … 154 179 155 180 String familyName() const; 181 Vector<FontVariationAxis> variationAxes() const; 156 182 157 183 #if USE(CAIRO) -
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
r267141 r270637 297 297 } 298 298 299 struct VariationDefaults { 300 float defaultValue; 301 float minimumValue; 302 float maximumValue; 303 }; 304 305 typedef HashMap<FontTag, VariationDefaults, FourCharacterTagHash, FourCharacterTagHashTraits> VariationDefaultsMap; 306 307 static VariationDefaultsMap defaultVariationValues(CTFontRef font) 299 VariationDefaultsMap defaultVariationValues(CTFontRef font) 308 300 { 309 301 VariationDefaultsMap result; … … 315 307 CFDictionaryRef axis = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(axes.get(), i)); 316 308 CFNumberRef axisIdentifier = static_cast<CFNumberRef>(CFDictionaryGetValue(axis, kCTFontVariationAxisIdentifierKey)); 309 String axisName = static_cast<CFStringRef>(CFDictionaryGetValue(axis, kCTFontVariationAxisNameKey)); 317 310 CFNumberRef defaultValue = static_cast<CFNumberRef>(CFDictionaryGetValue(axis, kCTFontVariationAxisDefaultValueKey)); 318 311 CFNumberRef minimumValue = static_cast<CFNumberRef>(CFDictionaryGetValue(axis, kCTFontVariationAxisMinimumValueKey)); … … 336 329 auto b4 = rawAxisIdentifier & 0xFF; 337 330 FontTag resultKey = {{ static_cast<char>(b1), static_cast<char>(b2), static_cast<char>(b3), static_cast<char>(b4) }}; 338 VariationDefaults resultValues = { rawDefaultValue, rawMinimumValue, rawMaximumValue };331 VariationDefaults resultValues = { axisName, rawDefaultValue, rawMinimumValue, rawMaximumValue }; 339 332 result.set(resultKey, resultValues); 340 333 } -
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h
r266690 r270637 51 51 }; 52 52 53 struct VariationDefaults { 54 String axisName; 55 float defaultValue; 56 float minimumValue; 57 float maximumValue; 58 }; 59 60 typedef HashMap<FontTag, VariationDefaults, FourCharacterTagHash, FourCharacterTagHashTraits> VariationDefaultsMap; 61 53 62 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations = true); 54 63 enum class ShouldComputePhysicalTraits : bool { No, Yes }; … … 62 71 RetainPtr<CFSetRef> installedFontMandatoryAttributes(AllowUserInstalledFonts); 63 72 73 VariationDefaultsMap defaultVariationValues(CTFontRef); 64 74 } -
trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
r267073 r270637 25 25 #import "FontPlatformData.h" 26 26 27 #import "FontCacheCoreText.h" 27 28 #import "SharedBuffer.h" 28 29 #import <pal/spi/cocoa/CoreTextSPI.h> … … 62 63 } 63 64 65 Vector<FontPlatformData::FontVariationAxis> FontPlatformData::variationAxes() const 66 { 67 auto platformFont = ctFont(); 68 if (!platformFont) 69 return { }; 70 71 Vector<FontVariationAxis> results; 72 for (auto& [tag, values] : defaultVariationValues(platformFont)) 73 results.append(FontPlatformData::FontVariationAxis(values.axisName, String(tag.data(), tag.size()), values.defaultValue, values.minimumValue, values.maximumValue)); 74 75 return results; 76 } 77 78 64 79 } // namespace WebCore -
trunk/Source/WebInspectorUI/ChangeLog
r270606 r270637 1 2020-12-10 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Show current properties for font in new Elements sidebar Font panel 4 https://bugs.webkit.org/show_bug.cgi?id=218964 5 6 Reviewed by Devin Rousso. 7 8 * Localizations/en.lproj/localizedStrings.js: 9 * UserInterface/Base/Setting.js: 10 - Added experimental setting for Font panel. 11 * UserInterface/Main.html: 12 * UserInterface/Models/DOMNodeStyles.js: 13 (WI.DOMNodeStyles): 14 (WI.DOMNodeStyles.prototype.get computedPrimaryFont): 15 (WI.DOMNodeStyles.prototype.refresh.fetchedComputedStyle): 16 (WI.DOMNodeStyles.prototype.refresh.fetchedFontData): 17 (WI.DOMNodeStyles.prototype.refresh): 18 - Support getting the computed primary font. 19 * UserInterface/Models/Font.js: Added. 20 (WI.Font): 21 (WI.Font.fromPayload): 22 (WI.Font.prototype.get name): 23 (WI.Font.prototype.get variationAxes): 24 (WI.Font.prototype.variationAxis): 25 - Model object for `CSS.Font`. 26 (WI.Font.prototype.calculateFontProperties): 27 - Build maps of font properties from the `DOMNodeStyle` and this Font. 28 (WI.Font.prototype._calculateProperties): 29 (WI.Font.prototype._calculateFontFeatureAxes): 30 (WI.Font.prototype._calculateFontVariationAxes): 31 (WI.Font.prototype._parseFontFeatureOrVariationSettings): 32 * UserInterface/Models/FontVariationAxis.js: Added. 33 (WI.FontVariationAxis): 34 (WI.FontVariationAxis.fromPayload): 35 (WI.FontVariationAxis.prototype.get name): 36 (WI.FontVariationAxis.prototype.get tag): 37 (WI.FontVariationAxis.prototype.get minimumValue): 38 (WI.FontVariationAxis.prototype.get maximumValue): 39 (WI.FontVariationAxis.prototype.get defaultValue): 40 - Model object for `CSS.FontVariationAxis`. 41 * UserInterface/Test.html: 42 * UserInterface/Views/ComputedStyleDetailsPanel.css: 43 (.sidebar > .panel.details.css-style > .content > .computed .property:not(:hover) .go-to-arrow): 44 (.multi-sidebar.showing-multiple > .sidebar > .panel.details.style-computed > .content > .pseudo-classes,): Deleted. 45 - Move multi-sidebar support to GeneralStyleDetailsSidebarPanel.css 46 * UserInterface/Views/ElementsTabContentView.js: 47 (WI.ElementsTabContentView): 48 - Add Font panel to detail panel set if enabled and supported. 49 * UserInterface/Views/FontDetailsPanel.js: Added. 50 (WI.FontDetailsPanel): 51 (WI.FontDetailsPanel.prototype.get supportsToggleCSSClass): 52 (WI.FontDetailsPanel.prototype.refresh): 53 (WI.FontDetailsPanel.prototype.initialLayout): 54 (WI.FontDetailsPanel.prototype._formatSizeValue): 55 (WI.FontDetailsPanel.prototype._formatStyleValue): 56 (WI.FontDetailsPanel.prototype._formatSimpleSingleValue): 57 - Format basic font properties. 58 (WI.FontDetailsPanel.prototype._formatVariationValue): 59 - Format non-standard variation axes. 60 (WI.FontDetailsPanel.prototype._formatSimpleFeatureValues): 61 - Common formatting for `font-variant-xxx` properties that map to font feature values. 62 (WI.FontDetailsPanel.prototype._formatLigatureValue): 63 (WI.FontDetailsPanel.prototype._formatPositionValue): 64 (WI.FontDetailsPanel.prototype._formatCapitalsValue): 65 (WI.FontDetailsPanel.prototype._formatNumericValue): 66 (WI.FontDetailsPanel.prototype._formatAlternatesValue): 67 (WI.FontDetailsPanel.prototype._formatEastAsianValue): 68 (WI.FontDetailsPanel.prototype._featureIsEnabled): 69 (WI.FontDetailsPanel.prototype._hasVariationValue): 70 * UserInterface/Views/FontDetailsSidebarPanel.js: Added. 71 (WI.FontDetailsSidebarPanel): 72 * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css: 73 (.sidebar > .panel.details.css-style > .content:not(.supports-new-rule) ~ .options-container > .new-rule,): 74 (.multi-sidebar.showing-multiple > .sidebar > .panel.details:not(.style-rules) > .content > .pseudo-classes,): 75 - When showing the Styles panel alongside another style-based panel, hide the pseudo-class and filter options. 76 * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js: 77 (WI.GeneralStyleDetailsSidebarPanel.prototype.styleDetailsPanelFocusFilterBar): 78 (WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout): 79 (WI.GeneralStyleDetailsSidebarPanel.prototype._showPanel): 80 (WI.GeneralStyleDetailsSidebarPanel.prototype._handleNodeChanged): 81 (WI.GeneralStyleDetailsSidebarPanel.prototype._filterDidChange): 82 - Support not showing the filter bar for style panels where filtering is not applicable. 83 * UserInterface/Views/SettingsTabContentView.js: 84 (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): 85 * UserInterface/Views/StyleDetailsPanel.js: 86 (WI.StyleDetailsPanel.prototype.get supportsToggleCSSClass): 87 (WI.StyleDetailsPanel.prototype.filterDidChange): Deleted. 88 - Remove empty implementation of `filterDidChange` as `WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout` 89 checks for an implmentation of this function to determine if a filter bar should be shown. 90 1 91 2020-11-30 Brian Burg <bburg@apple.com> 2 92 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r270604 r270637 2 2 3 3 localizedStrings[" (Prototype)"] = " (Prototype)"; 4 /* A range and default value for a single variation axis of a font. */ 5 localizedStrings[" (Range: %d-%d, Default: %d) @ Font Details Sidebar"] = " (Range: %d-%d, Default: %d)"; 4 6 localizedStrings[" (line %s)"] = " (line %s)"; 5 7 localizedStrings["${expr} = expression"] = "${expr} = expression"; … … 23 25 localizedStrings["%.2fs"] = "%.2fs"; 24 26 localizedStrings["%.3fms"] = "%.3fms"; 27 /* A value, range, and default value for a single variation axis of a font. */ 28 localizedStrings["%d (Range: %d-%d, Default: %d) @ Font Details Sidebar"] = "%d (Range: %d-%d, Default: %d)"; 25 29 localizedStrings["%d Error"] = "%d Error"; 26 30 localizedStrings["%d Errors"] = "%d Errors"; … … 49 53 localizedStrings["%d resource"] = "%d resource"; 50 54 localizedStrings["%d resources"] = "%d resources"; 55 localizedStrings["%d%%"] = "%d%%"; 51 56 localizedStrings["%dpx"] = "%dpx"; 52 57 localizedStrings["%dpx\u00B2"] = "%dpx\u00B2"; … … 137 142 /* Break (pause) on all microtasks */ 138 143 localizedStrings["All Microtasks @ JavaScript Breakpoint"] = "All Microtasks"; 144 /* Property value for `font-variant-capitals: all-petite-caps`. */ 145 localizedStrings["All Petite Capitals @ Font Details Sidebar Property Value"] = "All Petite Capitals"; 139 146 /* A submenu item of 'Break on' that breaks (pauses) before all network requests */ 140 147 localizedStrings["All Requests"] = "All Requests"; 148 /* Property value for `font-variant-capitals: all-small-caps`. */ 149 localizedStrings["All Small Capitals @ Font Details Sidebar Property Value"] = "All Small Capitals"; 141 150 localizedStrings["All Storage"] = "All Storage"; 142 151 /* Break (pause) on all timeouts */ … … 201 210 localizedStrings["Backtrace"] = "Backtrace"; 202 211 localizedStrings["Basic"] = "Basic"; 212 /* Section title for basic font properties. */ 213 localizedStrings["Basic Properties @ Font Details Sidebar Section"] = "Basic Properties"; 203 214 localizedStrings["Beacon"] = "Beacon"; 204 215 localizedStrings["Beacons"] = "Beacons"; … … 254 265 localizedStrings["Canvas Element"] = "Canvas Element"; 255 266 localizedStrings["Canvases"] = "Canvases"; 267 /* Property title for `font-variant-caps`. */ 268 localizedStrings["Capitals @ Font Details Sidebar Property"] = "Capitals"; 256 269 /* Capture screenshot of the selected DOM node */ 257 270 localizedStrings["Capture Screenshot"] = "Capture Screenshot"; … … 312 325 localizedStrings["Collect garbage"] = "Collect garbage"; 313 326 localizedStrings["Comment"] = "Comment"; 327 /* Property value for `font-variant-ligatures: common-ligatures`. */ 328 localizedStrings["Common @ Font Details Sidebar Property Value"] = "Common"; 314 329 localizedStrings["Compare snapshots"] = "Compare snapshots"; 315 330 localizedStrings["Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording"] = "Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording"; … … 343 358 localizedStrings["Containing"] = "Containing"; 344 359 localizedStrings["Content Security Policy violation of directive: %s"] = "Content Security Policy violation of directive: %s"; 360 /* Property value for `font-variant-ligatures: contextual`. */ 361 localizedStrings["Contextual Alternates @ Font Details Sidebar Property Value"] = "Contextual Alternates"; 345 362 localizedStrings["Continuation Frame"] = "Continuation Frame"; 346 363 localizedStrings["Continue script execution (%s or %s)"] = "Continue script execution (%s or %s)"; … … 427 444 localizedStrings["Device Settings"] = "Device Settings"; 428 445 localizedStrings["Diagnoses common accessibility problems affecting screen readers and other assistive technology."] = "Diagnoses common accessibility problems affecting screen readers and other assistive technology."; 446 /* Property value for `font-variant-numeric: diagonal-fractions`. */ 447 localizedStrings["Diagonal Fractions @ Font Details Sidebar Property Value"] = "Diagonal Fractions"; 429 448 localizedStrings["Dimensions"] = "Dimensions"; 430 449 localizedStrings["Disable Audit"] = "Disable Audit"; … … 444 463 localizedStrings["Disable:"] = "Disable:"; 445 464 localizedStrings["Disabled"] = "Disabled"; 465 /* Property value for `font-variant-ligatures: no-common-ligatures`. */ 466 localizedStrings["Disabled Common @ Font Details Sidebar Property Value"] = "Disabled Common"; 467 /* Property value for `font-variant-ligatures: discretionary-ligatures`. */ 468 localizedStrings["Discretionary @ Font Details Sidebar Property Value"] = "Discretionary"; 446 469 localizedStrings["Disk Cache"] = "Disk Cache"; 447 470 localizedStrings["Dismiss"] = "Dismiss"; … … 472 495 localizedStrings["Dynamically calculated for the selected element"] = "Dynamically calculated for the selected element"; 473 496 localizedStrings["Dynamically calculated for the selected element and did not match"] = "Dynamically calculated for the selected element and did not match"; 497 /* Property title for `font-variant-east-asian`. */ 498 localizedStrings["East Asian @ Font Details Sidebar Property"] = "East Asian"; 474 499 /* Label for a guide within the color picker */ 475 500 localizedStrings["Edge of sRGB color space"] = "Edge of sRGB color space"; … … 597 622 localizedStrings["Failed to upgrade"] = "Failed to upgrade"; 598 623 localizedStrings["Failure status code"] = "Failure status code"; 624 /* Section title for font feature properties. */ 625 localizedStrings["Feature Properties @ Font Details Sidebar Section"] = "Feature Properties"; 599 626 /* Resource loaded via 'fetch' method */ 600 627 localizedStrings["Fetch"] = "Fetch"; … … 612 639 localizedStrings["Focused"] = "Focused"; 613 640 localizedStrings["Font"] = "Font"; 641 /* Title for the Font details sidebar. */ 642 localizedStrings["Font @ Font Details Sidebar Title"] = "Font"; 614 643 localizedStrings["Fonts"] = "Fonts"; 615 644 localizedStrings["Force Dark Appearance"] = "Force Dark Appearance"; … … 644 673 localizedStrings["Full-Screen"] = "Full-Screen"; 645 674 localizedStrings["Full-Screen from \u201C%s\u201D"] = "Full-Screen from \u201C%s\u201D"; 675 /* Property value for `font-variant-alternates: full-width`. */ 676 localizedStrings["Full-Width Variants @ Font Details Sidebar Property Value"] = "Full-Width Variants"; 646 677 localizedStrings["Function"] = "Function"; 647 678 localizedStrings["Function Name Variable"] = "Function Name Variable"; … … 698 729 localizedStrings["High @ Timeline Energy Impact"] = "High"; 699 730 localizedStrings["Highest: %s"] = "Highest: %s"; 731 /* Property value for `font-variant-ligatures: historical-ligatures`. */ 732 localizedStrings["Historical @ Font Details Sidebar Property Value"] = "Historical"; 733 /* Property title for `font-variant-alternates`. */ 734 localizedStrings["Historical Figures @ Font Details Sidebar Property"] = "Historical Figures"; 735 /* Property value for `font-variant-alternates: historical-forms`. */ 736 localizedStrings["Historical Forms @ Font Details Sidebar Property Value"] = "Historical Forms"; 700 737 localizedStrings["Host"] = "Host"; 701 738 localizedStrings["ICO"] = "ICO"; … … 706 743 localizedStrings["Identifier"] = "Identifier"; 707 744 localizedStrings["Identity"] = "Identity"; 745 /* Section title for font identity information. */ 746 localizedStrings["Identity @ Font Details Sidebar Section"] = "Identity"; 708 747 localizedStrings["Idle"] = "Idle"; 709 748 localizedStrings["If the URL of any script matches one of the regular expression patterns below, any pauses that would have happened in that script will be deferred until execution has continued to outside of that script."] = "If the URL of any script matches one of the regular expression patterns below, any pauses that would have happened in that script will be deferred until execution has continued to outside of that script."; … … 749 788 localizedStrings["Invoke getter"] = "Invoke getter"; 750 789 localizedStrings["It is evaluated immediately after the global object is created, before any other content has loaded."] = "It is evaluated immediately after the global object is created, before any other content has loaded."; 790 /* Property value for oblique text. */ 791 localizedStrings["Italic @ Font Details Sidebar Property Value"] = "Italic"; 751 792 /* Tooltip for a timestamp marker that represents when a CSS animation/transition iterates */ 752 793 localizedStrings["Iteration"] = "Iteration"; 794 /* Property value for `font-variant-alternates: jis04`. */ 795 localizedStrings["JIS2004 Forms @ Font Details Sidebar Property Value"] = "JIS2004 Forms"; 796 /* Property value for `font-variant-alternates: jis78`. */ 797 localizedStrings["JIS78 Forms @ Font Details Sidebar Property Value"] = "JIS78 Forms"; 798 /* Property value for `font-variant-alternates: jis83`. */ 799 localizedStrings["JIS83 Forms @ Font Details Sidebar Property Value"] = "JIS83 Forms"; 800 /* Property value for `font-variant-alternates: jis90`. */ 801 localizedStrings["JIS90 Forms @ Font Details Sidebar Property Value"] = "JIS90 Forms"; 753 802 localizedStrings["JP2"] = "JP2"; 754 803 localizedStrings["JPEG"] = "JPEG"; … … 771 820 localizedStrings["Layout @ Timeline record"] = "Layout"; 772 821 localizedStrings["Layout Invalidated"] = "Layout Invalidated"; 822 /* Property title for `font-variant-ligatures`. */ 823 localizedStrings["Ligatures @ Font Details Sidebar Property"] = "Ligatures"; 773 824 /* Label of dropdown item used for forcing Web Inspector to be shown using a light theme */ 774 825 localizedStrings["Light @ Settings General Appearance"] = "Light"; … … 778 829 localizedStrings["Line wrapping:"] = "Line wrapping:"; 779 830 localizedStrings["Linear Gradient"] = "Linear Gradient"; 831 /* Property value for `font-variant-numeric: lining-nums`. */ 832 localizedStrings["Lining Numerals @ Font Details Sidebar Property Value"] = "Lining Numerals"; 780 833 localizedStrings["Live"] = "Live"; 781 834 localizedStrings["Live Activity"] = "Live Activity"; … … 852 905 localizedStrings["Multi-Entry"] = "Multi-Entry"; 853 906 localizedStrings["Name"] = "Name"; 907 /* Property title for the family name of the font. */ 908 localizedStrings["Name @ Font Details Sidebar Property"] = "Name"; 854 909 /* Label for the navigation sidebar. */ 855 910 localizedStrings["Navigation @ Sidebar"] = "Navigation"; … … 892 947 localizedStrings["No Styles"] = "No Styles"; 893 948 localizedStrings["No Watch Expressions"] = "No Watch Expressions"; 949 /* Message shown when there are no additional variation axes to show. */ 950 localizedStrings["No additional variation axes. @ Font Details Sidebar"] = "No additional variation axes."; 894 951 localizedStrings["No audit selected"] = "No audit selected"; 895 952 localizedStrings["No certificate security information."] = "No certificate security information."; … … 910 967 localizedStrings["Nodes"] = "Nodes"; 911 968 localizedStrings["None"] = "None"; 969 /* Property value for any `normal` CSS value. */ 970 localizedStrings["Normal @ Font Details Sidebar Property Value"] = "Normal"; 912 971 localizedStrings["Not found"] = "Not found"; 913 972 /* Title of icon indicating that the selected audit has not been run yet. */ 914 973 localizedStrings["Not yet run @ Audit Tab - Test Case"] = "Not yet run"; 974 /* Property title for `font-variant-numeric`. */ 975 localizedStrings["Numeric @ Font Details Sidebar Property"] = "Numeric"; 915 976 localizedStrings["Object Graph"] = "Object Graph"; 916 977 localizedStrings["Object Store"] = "Object Store"; 978 /* Property value for oblique text. */ 979 localizedStrings["Oblique %ddeg @ Font Details Sidebar Property Value"] = "Oblique %ddeg"; 917 980 localizedStrings["Observer Callback"] = "Observer Callback"; 918 981 localizedStrings["Observer Handlers:"] = "Observer Handlers:"; … … 923 986 /* Input label for the y-axis of the offset of a CSS box shadow */ 924 987 localizedStrings["Offset Y @ Box Shadow Editor"] = "Offset Y"; 988 /* Property value for `font-variant-numeric: oldstyle-nums`. */ 989 localizedStrings["Old-Style Numerals @ Font Details Sidebar Property Value"] = "Old-Style Numerals"; 925 990 localizedStrings["Once"] = "Once"; 926 991 localizedStrings["Online"] = "Online"; … … 931 996 localizedStrings["Option-click to show source"] = "Option-click to show source"; 932 997 localizedStrings["Options"] = "Options"; 998 /* Property value for `font-variant-numeric: ordinal`. */ 999 localizedStrings["Ordinal Letter Forms @ Font Details Sidebar Property Value"] = "Ordinal Letter Forms"; 933 1000 localizedStrings["Original formatting"] = "Original formatting"; 934 1001 localizedStrings["Originally %s"] = "Originally %s"; … … 970 1037 localizedStrings["Percentage (of audits)"] = "%s%%"; 971 1038 localizedStrings["Periods of high CPU utilization will rapidly drain battery. Strive to keep idle pages under %s average CPU utilization."] = "Periods of high CPU utilization will rapidly drain battery. Strive to keep idle pages under %s average CPU utilization."; 1039 /* Property value for `font-variant-capitals: petite-caps`. */ 1040 localizedStrings["Petite Capitals @ Font Details Sidebar Property Value"] = "Petite Capitals"; 972 1041 localizedStrings["Ping"] = "Ping"; 973 1042 localizedStrings["Ping Frame"] = "Ping Frame"; … … 979 1048 localizedStrings["Pong Frame"] = "Pong Frame"; 980 1049 localizedStrings["Port"] = "Port"; 1050 /* Property title for `font-variant-position`. */ 1051 localizedStrings["Position @ Font Details Sidebar Property"] = "Position"; 981 1052 localizedStrings["Power Efficient Playback"] = "Power Efficient Playback"; 982 1053 localizedStrings["Prefer Shorthands"] = "Prefer Shorthands"; … … 1008 1079 localizedStrings["Properties"] = "Properties"; 1009 1080 localizedStrings["Property"] = "Property"; 1081 /* Property value for `font-variant-numeric: proportional-nums`. */ 1082 localizedStrings["Proportional Numerals @ Font Details Sidebar Property Value"] = "Proportional Numerals"; 1083 /* Property value for `font-variant-alternates: proportional-width`. */ 1084 localizedStrings["Proportional-Width Variants @ Font Details Sidebar Property Value"] = "Proportional-Width Variants"; 1010 1085 localizedStrings["Protocol"] = "Protocol"; 1011 1086 localizedStrings["Pseudo-Element"] = "Pseudo-Element"; … … 1123 1198 localizedStrings["Reveal in Style Sheet"] = "Reveal in Style Sheet"; 1124 1199 localizedStrings["Role"] = "Role"; 1200 /* Property value for `font-variant-alternates: ruby`. */ 1201 localizedStrings["Ruby Glyphs @ Font Details Sidebar Property Value"] = "Ruby Glyphs"; 1125 1202 localizedStrings["Run %d"] = "Run %d"; 1126 1203 localizedStrings["Run console commands as if inside a user gesture"] = "Run console commands as if inside a user gesture"; … … 1211 1288 localizedStrings["Show Console tab"] = "Show Console tab"; 1212 1289 localizedStrings["Show Elements"] = "Show Elements"; 1290 localizedStrings["Show Font details sidebar panel"] = "Show Font details sidebar panel"; 1213 1291 localizedStrings["Show Path"] = "Show Path"; 1214 1292 localizedStrings["Show Remaining (%d)"] = "Show Remaining (%d)"; … … 1233 1311 localizedStrings["Show type information"] = "Show type information"; 1234 1312 localizedStrings["Show:"] = "Show:"; 1313 /* Property value for `font-variant-alternates: simplified`. */ 1314 localizedStrings["Simplified Forms @ Font Details Sidebar Property Value"] = "Simplified Forms"; 1235 1315 localizedStrings["Site-specific Hacks"] = "Site-specific Hacks"; 1236 1316 localizedStrings["Size"] = "Size"; 1317 /* Property title for `font-size`. */ 1318 localizedStrings["Size @ Font Details Sidebar Property"] = "Size"; 1237 1319 localizedStrings["Size of current object plus all objects it keeps alive"] = "Size of current object plus all objects it keeps alive"; 1238 1320 localizedStrings["Sizes"] = "Sizes"; 1239 1321 /* Label for checkbox that controls whether the local override will actually perform a network request or skip it to immediately serve the response. */ 1240 1322 localizedStrings["Skip Network @ Local Override Popover Options"] = "Skip Network"; 1323 /* Property value for `font-variant-numeric: slashed-zero`. */ 1324 localizedStrings["Slashed Zeros @ Font Details Sidebar Property Value"] = "Slashed Zeros"; 1325 /* Property value for `font-variant-capitals: small-caps`. */ 1326 localizedStrings["Small Capitals @ Font Details Sidebar Property Value"] = "Small Capitals"; 1241 1327 localizedStrings["Snapshot %d"] = "Snapshot %d"; 1242 1328 localizedStrings["Snapshot %d \u2014 %s"] = "Snapshot %d \u2014 %s"; … … 1261 1347 /* Input label for the spread radius of a CSS box shadow */ 1262 1348 localizedStrings["Spread @ Box Shadow Editor"] = "Spread"; 1349 /* Property value for `font-variant-numeric: stacked-fractions`. */ 1350 localizedStrings["Stacked Fractions @ Font Details Sidebar Property Value"] = "Stacked Fractions"; 1263 1351 localizedStrings["Staging:"] = "Staging:"; 1264 1352 localizedStrings["Stalled"] = "Stalled"; … … 1296 1384 /* Name of Storage Tab */ 1297 1385 localizedStrings["Storage Tab Name"] = "Storage"; 1386 /* Property title for `font-stretch`. */ 1387 localizedStrings["Stretch @ Font Details Sidebar Property"] = "Stretch"; 1388 /* Property title for `font-style`. */ 1389 localizedStrings["Style @ Font Details Sidebar Property"] = "Style"; 1298 1390 /* CSS properties defined via HTML style attribute */ 1299 1391 localizedStrings["Style Attribute"] = "Style Attribute"; … … 1308 1400 localizedStrings["Styles:"] = "Styles:"; 1309 1401 localizedStrings["Subject"] = "Subject"; 1402 /* Property value for `font-variant-position: sub`. */ 1403 localizedStrings["Subscript @ Font Details Sidebar Property Value"] = "Subscript"; 1310 1404 /* A submenu item of 'Break On' that breaks (pauses) before child DOM node is modified */ 1311 1405 localizedStrings["Subtree Modified @ DOM Breakpoint"] = "Subtree Modified"; 1312 1406 localizedStrings["Summary"] = "Summary"; 1407 /* Property value for `font-variant-position: super`. */ 1408 localizedStrings["Superscript @ Font Details Sidebar Property Value"] = "Superscript"; 1313 1409 /* Label of dropdown item used for forcing Web Inspector to be shown using the system's theme */ 1314 1410 localizedStrings["System @ Settings General Appearance"] = "System"; … … 1317 1413 localizedStrings["Tab width:"] = "Tab width:"; 1318 1414 localizedStrings["Tabs"] = "Tabs"; 1415 /* Property value for `font-variant-numeric: tabular-nums`. */ 1416 localizedStrings["Tabular Numerals @ Font Details Sidebar Property Value"] = "Tabular Numerals"; 1319 1417 /* A submenu item of 'Edit' to change DOM element's tag name */ 1320 1418 localizedStrings["Tag"] = "Tag"; … … 1401 1499 localizedStrings["Timestamp \u2014 %s"] = "Timestamp \u2014 %s"; 1402 1500 localizedStrings["Timing"] = "Timing"; 1501 /* Property value for `font-variant-capitals: titling-caps`. */ 1502 localizedStrings["Titling Capitals @ Font Details Sidebar Property Value"] = "Titling Capitals"; 1403 1503 localizedStrings["To improve CPU utilization reduce or batch workloads when the page is not visible or during times when the page is not being interacted with."] = "To improve CPU utilization reduce or batch workloads when the page is not visible or during times when the page is not being interacted with."; 1404 1504 localizedStrings["Toggle Classes"] = "Toggle Classes"; … … 1414 1514 localizedStrings["Trace: %s"] = "Trace: %s"; 1415 1515 localizedStrings["Traces:"] = "Traces:"; 1516 /* Property value for `font-variant-alternates: traditional`. */ 1517 localizedStrings["Traditional Forms @ Font Details Sidebar Property Value"] = "Traditional Forms"; 1416 1518 /* Amount of data sent over the network for a single resource */ 1417 1519 localizedStrings["Transfer Size"] = "Transfer Size"; … … 1433 1535 localizedStrings["Uncaught Exceptions @ JavaScript Breakpoint"] = "Uncaught Exceptions"; 1434 1536 localizedStrings["Undefined custom element"] = "Undefined custom element"; 1537 /* Property value for `font-variant-capitals: unicase`. */ 1538 localizedStrings["Unicase @ Font Details Sidebar Property Value"] = "Unicase"; 1435 1539 localizedStrings["Unique"] = "Unique"; 1436 1540 localizedStrings["Unknown Location"] = "Unknown Location"; … … 1458 1562 localizedStrings["Value"] = "Value"; 1459 1563 localizedStrings["Variables"] = "Variables"; 1564 /* Section title for font variation properties. */ 1565 localizedStrings["Variation Properties @ Font Details Sidebar Section"] = "Variation Properties"; 1460 1566 localizedStrings["Verbose"] = "Verbose"; 1461 1567 localizedStrings["Version"] = "Version"; … … 1540 1646 localizedStrings["WebRTC Logging:"] = "WebRTC Logging:"; 1541 1647 localizedStrings["WebSocket Connection Established"] = "WebSocket Connection Established"; 1648 /* Property title for `font-weight`. */ 1649 localizedStrings["Weight @ Font Details Sidebar Property"] = "Weight"; 1542 1650 localizedStrings["Whitespace characters"] = "Whitespace characters"; 1543 1651 localizedStrings["Width"] = "Width"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js
r268929 r270637 224 224 experimentalEnableStylesJumpToVariableDeclaration: new WI.Setting("experimental-styles-jump-to-variable-declaration", false), 225 225 experimentalEnableIndependentStylesPanel: new WI.Setting("experimental-independent-styles-panel", false), 226 experimentalEnableFontDetailsPanel: new WI.Setting("experimental-font-details-panel", false), 226 227 227 228 // Protocol -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r270606 r270637 410 410 <script src="Models/ExecutionContextList.js"></script> 411 411 <script src="Models/FPSInstrument.js"></script> 412 <script src="Models/Font.js"></script> 413 <script src="Models/FontVariationAxis.js"></script> 412 414 <script src="Models/Frame.js"></script> 413 415 <script src="Models/GarbageCollection.js"></script> … … 691 693 <script src="Views/FindBanner.js"></script> 692 694 <script src="Views/FlexibleSpaceNavigationItem.js"></script> 695 <script src="Views/FontDetailsPanel.js"></script> 696 <script src="Views/FontDetailsSidebarPanel.js"></script> 693 697 <script src="Views/FontResourceContentView.js"></script> 694 698 <script src="Views/FormattedValue.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
r269359 r270637 44 44 this._orderedStyles = []; 45 45 46 this._computedPrimaryFont = null; 47 46 48 this._propertyNameToEffectivePropertyMap = {}; 47 49 … … 127 129 get computedStyle() { return this._computedStyle; } 128 130 get orderedStyles() { return this._orderedStyles; } 131 get computedPrimaryFont() { return this._computedPrimaryFont; } 129 132 130 133 get needsRefresh() … … 157 160 let fetchedInlineStylesPromise = new WI.WrappedPromise; 158 161 let fetchedComputedStylesPromise = new WI.WrappedPromise; 162 let fetchedFontDataPromise = new WI.WrappedPromise; 159 163 160 164 // Ensure we resolve these promises even in the case of an error. … … 311 315 this._includeUserAgentRulesOnNextRefresh = false; 312 316 313 this.dispatchEventToListeners(WI.DOMNodeStyles.Event.Refreshed, {significantChange}); 314 315 fetchedComputedStylesPromise.resolve(); 317 fetchedComputedStylesPromise.resolve({significantChange}); 318 } 319 320 function fetchedFontData(error, fontDataPayload) 321 { 322 if (fontDataPayload) 323 this._computedPrimaryFont = WI.Font.fromPayload(fontDataPayload); 324 else 325 this._computedPrimaryFont = null; 326 327 fetchedFontDataPromise.resolve(); 316 328 } 317 329 … … 321 333 target.CSSAgent.getComputedStyleForNode.invoke({nodeId: this._node.id}, wrap.call(this, fetchedComputedStyle, fetchedComputedStylesPromise)); 322 334 323 this._pendingRefreshTask = Promise.all([fetchedMatchedStylesPromise.promise, fetchedInlineStylesPromise.promise, fetchedComputedStylesPromise.promise]) 324 .then(() => { 335 // COMPATIBILITY (iOS 14.0): `CSS.getFontDataForNode` did not exist yet. 336 if (InspectorBackend.hasCommand("CSS.getFontDataForNode")) 337 target.CSSAgent.getFontDataForNode.invoke({nodeId: this._node.id}, wrap.call(this, fetchedFontData, fetchedFontDataPromise)); 338 else 339 fetchedFontDataPromise.resolve(); 340 341 this._pendingRefreshTask = Promise.all([fetchedComputedStylesPromise.promise, fetchedMatchedStylesPromise.promise, fetchedInlineStylesPromise.promise, fetchedFontDataPromise.promise]) 342 .then(([fetchComputedStylesResult]) => { 325 343 this._pendingRefreshTask = null; 344 this.dispatchEventToListeners(WI.DOMNodeStyles.Event.Refreshed, { 345 significantChange: fetchComputedStylesResult.significantChange, 346 }); 326 347 return this; 327 348 }); -
trunk/Source/WebInspectorUI/UserInterface/Test.html
r270604 r270637 158 158 <script src="Models/ExecutionContextList.js"></script> 159 159 <script src="Models/FPSInstrument.js"></script> 160 <script src="Models/Font.js"></script> 161 <script src="Models/FontVariationAxis.js"></script> 160 162 <script src="Models/Frame.js"></script> 161 163 <script src="Models/GarbageCollection.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.css
r268691 r270637 61 61 display: none; 62 62 } 63 64 .multi-sidebar.showing-multiple > .sidebar > .panel.details.style-computed > .content > .pseudo-classes,65 .multi-sidebar.showing-multiple > .sidebar > .panel.details.style-computed > .options-container > .toggle-class-toggle,66 .multi-sidebar.showing-multiple > .sidebar > .panel.details.style-computed > .class-list-container {67 display: none;68 }69 70 -
trunk/Source/WebInspectorUI/UserInterface/Views/ElementsTabContentView.js
r270134 r270637 31 31 WI.RulesStyleDetailsSidebarPanel, 32 32 WI.ComputedStyleDetailsSidebarPanel, 33 WI.ChangesDetailsSidebarPanel, 34 WI.DOMNodeDetailsSidebarPanel, 33 35 34 ]; 35 // COMPATIBILITY (iOS 14.0): `CSS.getFontDataForNode` did not exist yet. 36 if (WI.settings.experimentalEnableFontDetailsPanel.value && InspectorBackend.hasCommand("CSS.getFontDataForNode")) 37 detailsSidebarPanelConstructors.push(WI.FontDetailsSidebarPanel); 38 detailsSidebarPanelConstructors.push(WI.ChangesDetailsSidebarPanel, WI.DOMNodeDetailsSidebarPanel); 36 39 if (InspectorBackend.hasDomain("LayerTree")) 37 40 detailsSidebarPanelConstructors.push(WI.LayerTreeDetailsSidebarPanel); -
trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.css
r269166 r270637 135 135 136 136 .sidebar > .panel.details.css-style > .content:not(.supports-new-rule) ~ .options-container > .new-rule, 137 .sidebar > .panel.details.css-style > .content:not(.has-filter-bar) ~ .options-container > .filter-bar { 137 .sidebar > .panel.details.css-style > .content:not(.supports-toggle-css-class) ~ .options-container > .toggle-class-toggle, 138 .sidebar > .panel.details.css-style > .content:not(.has-filter-bar) ~ .options-container > .filter-bar, 139 .sidebar > .panel.details.css-style > .content:not(.supports-new-rule):not(.supports-toggle-class):not(.has-filter-bar) ~ .options-container { 138 140 display: none; 139 141 } … … 231 233 overflow-y: auto; 232 234 } 235 236 .multi-sidebar.showing-multiple > .sidebar > .panel.details:not(.style-rules) > .content > .pseudo-classes, 237 .multi-sidebar.showing-multiple > .sidebar > .panel.details:not(.style-rules) > .options-container, 238 .multi-sidebar.showing-multiple > .sidebar > .panel.details:not(.style-rules) > .class-list-container { 239 display: none; 240 } -
trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js
r270134 r270637 85 85 styleDetailsPanelFocusFilterBar(styleDetailsPanel) 86 86 { 87 this._filterBar.inputField.focus(); 87 if (this._filterBar) 88 this._filterBar.inputField.focus(); 88 89 } 89 90 … … 185 186 newRuleButton.addEventListener("contextmenu", this._newRuleButtonContextMenu.bind(this)); 186 187 187 this._filterBar = new WI.FilterBar; 188 this._filterBar.addEventListener(WI.FilterBar.Event.FilterDidChange, this._filterDidChange, this); 189 this._filterBar.inputField.addEventListener("keydown", this._handleFilterBarInputFieldKeyDown.bind(this)); 190 optionsContainer.appendChild(this._filterBar.element); 188 if (typeof this._panel.filterDidChange === "function") { 189 this._filterBar = new WI.FilterBar; 190 this._filterBar.addEventListener(WI.FilterBar.Event.FilterDidChange, this._filterDidChange, this); 191 this._filterBar.inputField.addEventListener("keydown", this._handleFilterBarInputFieldKeyDown.bind(this)); 192 optionsContainer.appendChild(this._filterBar.element); 193 } 191 194 192 195 if (this._classListContainer) { … … 202 205 WI.cssManager.addEventListener(WI.CSSManager.Event.StyleSheetAdded, this._styleSheetAddedOrRemoved, this); 203 206 WI.cssManager.addEventListener(WI.CSSManager.Event.StyleSheetRemoved, this._styleSheetAddedOrRemoved, this); 204 205 207 } 206 208 … … 233 235 { 234 236 this.contentView.addSubview(this._panel); 235 236 let hasFilter = typeof this._panel.filterDidChange === "function"; 237 this.contentView.element.classList.toggle("has-filter-bar", hasFilter); 237 this.contentView.element.classList.toggle("has-filter-bar", this._filterBar); 238 238 if (this._filterBar) 239 this.contentView.element.classList.toggle(WI.GeneralStyleDetailsSidebarPanel.FilterInProgressClassName, hasFilter &&this._filterBar.hasActiveFilters());239 this.contentView.element.classList.toggle(WI.GeneralStyleDetailsSidebarPanel.FilterInProgressClassName, this._filterBar.hasActiveFilters()); 240 240 } 241 241 … … 243 243 { 244 244 this.contentView.element.classList.toggle("supports-new-rule", this._panel.supportsNewRule); 245 this.contentView.element.classList.toggle("supports-toggle-css-class", this._panel.supportsToggleCSSClass); 245 246 } 246 247 … … 423 424 _filterDidChange() 424 425 { 426 if (!this._filterBar) 427 return; 428 425 429 this.contentView.element.classList.toggle(WI.GeneralStyleDetailsSidebarPanel.FilterInProgressClassName, this._filterBar.hasActiveFilters()); 426 430 -
trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
r269359 r270637 400 400 } 401 401 402 experimentalSettingsView.addSetting(WI.UIString("Elements Tab:", "Elements Tab: @ Experimental Settings", "Category label for experimental settings pertaining to the Elements tab"), WI.settings.experimentalEnableIndependentStylesPanel, WI.UIString("Show independent Styles sidebar")); 402 let elementsGroup = experimentalSettingsView.addGroup(WI.UIString("Elements Tab:", "Elements Tab: @ Experimental Settings", "Category label for experimental settings pertaining to the Elements tab")); 403 elementsGroup.addSetting(WI.settings.experimentalEnableIndependentStylesPanel, WI.UIString("Show independent Styles sidebar")); 404 elementsGroup.addSetting(WI.settings.experimentalEnableFontDetailsPanel, WI.UIString("Show Font details sidebar panel")); 403 405 experimentalSettingsView.addSeparator(); 404 406 … … 427 429 428 430 listenForChange(WI.settings.experimentalEnableIndependentStylesPanel); 431 listenForChange(WI.settings.experimentalEnableFontDetailsPanel); 429 432 430 433 this._createReferenceLink(experimentalSettingsView); -
trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js
r270134 r270637 57 57 } 58 58 59 get supportsToggleCSSClass() 60 { 61 // Overriden by subclasses if needed. 62 return true; 63 } 64 59 65 attached() 60 66 { … … 107 113 } 108 114 109 filterDidChange(filterBar)110 {111 // Implemented by subclasses.112 }113 114 115 // Private 115 116
Note: See TracChangeset
for help on using the changeset viewer.