⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185789 in webkit


Ignore:
Timestamp:
Jun 19, 2015, 11:20:21 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Duplication of style attribute in rules panel for shadow content
https://bugs.webkit.org/show_bug.cgi?id=146176

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-06-19
Reviewed by Timothy Hatcher.

  • UserInterface/Views/CSSStyleDeclarationTextEditor.js:

The styleText can be non-empty for a readonly editor if the editor is for
the style attribute of a shadow dom node. Instead of assuming it is empty
we can just clear the editor ourselves and regenerate from properties.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r185784 r185789  
     12015-06-19  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Duplication of style attribute in rules panel for shadow content
     4        https://bugs.webkit.org/show_bug.cgi?id=146176
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
     9        The styleText can be non-empty for a readonly editor if the editor is for
     10        the style attribute of a shadow dom node. Instead of assuming it is empty
     11        we can just clear the editor ourselves and regenerate from properties.
     12
    1132015-06-19  Devin Rousso  <drousso@apple.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js

    r185757 r185789  
    10531053            var findWhitespace = /\s+/g;
    10541054
    1055             // Only format non-empty styles. Keep in mind that styleText is always empty
    1056             // for "readOnly" Editors. But prepare Checkbox placeholders in any case.
    1057             // Because that will indent the cursor when the User starts typing.
     1055            // We only need to format non-empty styles, but prepare checkbox placeholders
     1056            // in any case because that will indent the cursor when the User starts typing.
    10581057            if (!styleText && !isEditorReadOnly) {
    10591058                this._markLinesWithCheckboxPlaceholder();
     
    10611060            }
    10621061
    1063             // Set non-optimized, valid and invalid styles in preparation for the Formatter.
    1064             // Set empty string in case of readonly styles.
    1065             this._codeMirror.setValue(styleText);
    1066 
     1062            // Generate formatted content for readonly editors by iterating properties.
    10671063            if (isEditorReadOnly) {
     1064                this._codeMirror.setValue("");
    10681065                var lineNumber = 0;
    10691066                this._iterateOverProperties(false, function(property) {
     
    10751072                    lineNumber++;
    10761073                });
    1077 
    10781074                return;
    10791075            }
     1076
     1077            // Set non-optimized, valid and invalid styles in preparation for the Formatter.
     1078            this._codeMirror.setValue(styleText);
    10801079
    10811080            // Now the Formatter pretty prints the styles.
Note: See TracChangeset for help on using the changeset viewer.