Changeset 241011 in webkit
- Timestamp:
- Feb 5, 2019 10:54:43 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r241010 r241011 1 2019-02-05 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty 4 https://bugs.webkit.org/show_bug.cgi?id=194318 5 6 Reviewed by Devin Rousso. 7 8 Fix the flaky test on Debug. 9 10 * inspector/css/modify-css-property-race-expected.txt: 11 * inspector/css/modify-css-property-race.html: 12 1 13 2019-02-05 Megan Gardner <megan_gardner@apple.com> 2 14 -
trunk/LayoutTests/inspector/css/modify-css-property-race-expected.txt
r240989 r241011 4 4 == Running test suite: ModifyCSSProperty 5 5 -- Running test case: ModifyCSSPropertyRace.ChangeInlineStyle 6 PASS: Height should be greater than 42px. 7 PASS: Height should be greater than 42px. 8 PASS: Height should be 10px. 9 PASS: CSSStyleDeclaration text should update. 10 PASS: Height should be greater or equal 10px. 6 PASS: Height should have increased from 10px. 7 PASS: Height should have increased from 11px. 8 PASS: Height should be 100px or more. 9 PASS: Height should be 101px or more. 11 10 -
trunk/LayoutTests/inspector/css/modify-css-property-race.html
r240989 r241011 8 8 function expand() { 9 9 let element = document.getElementById("x"); 10 let initialHeight = parseInt(element.style.height);11 10 let i = 0; 12 11 13 12 let loop = () => { 14 13 ++i; 15 let height = initialHeight + i;14 let height = parseInt(element.style.height) + 1; 16 15 element.style.height = height + "px"; 17 16 TestPage.dispatchEventToFrontend("TestPage-styleChanged", height + "px"); … … 64 63 let updateCount = 0; 65 64 66 function styleDecorationUpdated(event) { 67 if (!updateCount) { 68 let valueNumber = parseInt(getProperty("height").rawValue); 69 InspectorTest.expectGreaterThan(valueNumber, 42, "Height should be greater than 42px."); 70 } else if (updateCount === 1) { 71 let valueNumber = parseInt(getProperty("height").rawValue); 72 InspectorTest.expectGreaterThan(valueNumber, 42, "Height should be greater than 42px."); 73 getProperty("height").rawValue = "10px"; 74 } else if (updateCount === 2) { 75 InspectorTest.expectEqual(getProperty("height").rawValue, "10px", "Height should be 10px."); 76 InspectorTest.expectEqual(getInlineStyleDeclaration().text, "height: 10px;", "CSSStyleDeclaration text should update."); 77 } else { 78 let valueNumber = parseInt(getProperty("height").rawValue); 79 InspectorTest.expectGreaterThanOrEqual(valueNumber, 10, "Height should be greater or equal 10px."); 65 function styleDecorationUpdated() { 66 ++updateCount; 67 let heightNumber = parseInt(getProperty("height").rawValue); 68 69 if (updateCount === 1) 70 InspectorTest.expectGreaterThan(heightNumber, 10, "Height should have increased from 10px."); 71 else if (updateCount === 2) { 72 InspectorTest.expectGreaterThan(heightNumber, 11, "Height should have increased from 11px."); 73 getProperty("height").rawValue = "100px"; 74 } else if (updateCount === 3) 75 InspectorTest.expectGreaterThanOrEqual(heightNumber, 100, "Height should be 100px or more."); 76 else { 77 InspectorTest.expectGreaterThanOrEqual(heightNumber, 101, "Height should be 101px or more."); 80 78 81 79 InspectorTest.evaluateInPage("stopExpanding()"); … … 83 81 resolve(); 84 82 } 85 ++updateCount;86 83 } 87 84 88 WI.CSSStyleDeclaration.addEventListener(WI.CSSStyleDeclaration.Event.PropertiesChanged, styleDecorationUpdated); 85 let style = getInlineStyleDeclaration(); 86 style.addEventListener(WI.CSSStyleDeclaration.Event.PropertiesChanged, styleDecorationUpdated); 89 87 } 90 88 }); … … 113 111 <body onload="runTest()"> 114 112 <p>Testing that changes to "style" attribute made from page's JavaScript are ignored when there's a pending change made via Web Inspector.</p> 115 <div id="x" style="height: 42px"></div>113 <div id="x" style="height: 10px"></div> 116 114 </body> 117 115 </html> -
trunk/LayoutTests/inspector/css/modify-css-property.html
r240946 r241011 118 118 let styleDeclaration = getInlineStyleDeclaration(); 119 119 120 styleDeclaration.awaitEvent(WI.CSSStyleDeclaration.Event.PropertiesChanged).then((event) => {120 WI.CSSStyleDeclaration.awaitEvent(WI.CSSStyleDeclaration.Event.PropertiesChanged).then((event) => { 121 121 InspectorTest.expectThat(!styleDeclaration.locked, `Style declaration is unlocked.`); 122 122 InspectorTest.expectEqual(getProperty("width").rawValue, "200px", `"width" property value should update to "200px".`); -
trunk/Source/WebInspectorUI/ChangeLog
r241004 r241011 1 2019-02-05 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty 4 https://bugs.webkit.org/show_bug.cgi?id=194318 5 6 Reviewed by Devin Rousso. 7 8 Previously, WI.CSSStyleDeclaration.Event.PropertiesChanged fired when 9 old text and new text were empty strings. 10 11 * UserInterface/Models/CSSStyleDeclaration.js: 12 1 13 2019-02-05 Devin Rousso <drousso@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
r240946 r241011 174 174 return; 175 175 176 // Don't fire the event if there is text and it hasn't changed. 177 if (oldText && this._text && oldText === this._text) 176 // Don't fire the event if text hasn't changed. However, it should still fire for Computed style declarations 177 // because it never has text. 178 if (oldText === this._text && this._type !== WI.CSSStyleDeclaration.Type.Computed) 178 179 return; 179 180
Note: See TracChangeset
for help on using the changeset viewer.