WebKit Bugzilla
Attachment 361249 Details for
Bug 194318
: Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 6.57 KB, created by
Nikita Vasilyev
on 2019-02-05 16:49:48 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2019-02-05 16:49:48 PST
Size:
6.57 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 74908a7fa06..b8237b94ebc 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-05 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty >+ https://bugs.webkit.org/show_bug.cgi?id=194318 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fix test failures on Debug. >+ >+ * inspector/css/modify-css-property-race-expected.txt: >+ * inspector/css/modify-css-property-race.html: >+ > 2019-02-05 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Fix modify-css-property-race.html test failures >diff --git a/LayoutTests/inspector/css/modify-css-property-race-expected.txt b/LayoutTests/inspector/css/modify-css-property-race-expected.txt >index 139125488ac..5d6888d12ca 100644 >--- a/LayoutTests/inspector/css/modify-css-property-race-expected.txt >+++ b/LayoutTests/inspector/css/modify-css-property-race-expected.txt >@@ -3,9 +3,8 @@ Testing that changes to "style" attribute made from page's JavaScript are ignore > > == Running test suite: ModifyCSSProperty > -- Running test case: ModifyCSSPropertyRace.ChangeInlineStyle >-PASS: Height should be greater than 42px. >-PASS: Height should be greater than 42px. >-PASS: Height should be 10px. >-PASS: CSSStyleDeclaration text should update. >-PASS: Height should be greater or equal 10px. >+PASS: Height should be greater than 10px. >+PASS: Height should be greater than 11px. >+PASS: Height should be greater or equal 100px. >+PASS: Height should be greater or equal 101px. > >diff --git a/LayoutTests/inspector/css/modify-css-property-race.html b/LayoutTests/inspector/css/modify-css-property-race.html >index f72b4f020ee..87284a657a4 100644 >--- a/LayoutTests/inspector/css/modify-css-property-race.html >+++ b/LayoutTests/inspector/css/modify-css-property-race.html >@@ -7,12 +7,11 @@ let requestAnimationFrameID; > > function expand() { > let element = document.getElementById("x"); >- let initialHeight = parseInt(element.style.height); > let i = 0; > > let loop = () => { > ++i; >- let height = initialHeight + i; >+ let height = parseInt(element.style.height) + 1; > element.style.height = height + "px"; > TestPage.dispatchEventToFrontend("TestPage-styleChanged", height + "px"); > >@@ -63,26 +62,24 @@ function test() { > InspectorTest.evaluateInPage("expand()"); > let updateCount = 0; > >- function styleDecorationUpdated(event) { >- if (!updateCount) { >- let valueNumber = parseInt(getProperty("height").rawValue); >- InspectorTest.expectGreaterThan(valueNumber, 42, "Height should be greater than 42px."); >- } else if (updateCount === 1) { >- let valueNumber = parseInt(getProperty("height").rawValue); >- InspectorTest.expectGreaterThan(valueNumber, 42, "Height should be greater than 42px."); >- getProperty("height").rawValue = "10px"; >- } else if (updateCount === 2) { >- InspectorTest.expectEqual(getProperty("height").rawValue, "10px", "Height should be 10px."); >- InspectorTest.expectEqual(getInlineStyleDeclaration().text, "height: 10px;", "CSSStyleDeclaration text should update."); >- } else { >- let valueNumber = parseInt(getProperty("height").rawValue); >- InspectorTest.expectGreaterThanOrEqual(valueNumber, 10, "Height should be greater or equal 10px."); >+ function styleDecorationUpdated() { >+ ++updateCount; >+ let heightNumber = parseInt(getProperty("height").rawValue); >+ >+ if (updateCount === 1) >+ InspectorTest.expectGreaterThan(heightNumber, 10, "Height should be greater than 10px."); >+ else if (updateCount === 2) { >+ InspectorTest.expectGreaterThan(heightNumber, 11, "Height should be greater than 11px."); >+ getProperty("height").rawValue = "100px"; >+ } else if (updateCount === 3) >+ InspectorTest.expectGreaterThanOrEqual(heightNumber, 100, "Height should be greater or equal 100px."); >+ else { >+ InspectorTest.expectGreaterThanOrEqual(heightNumber, 101, "Height should be greater or equal 101px."); > > InspectorTest.evaluateInPage("stopExpanding()"); > WI.CSSStyleDeclaration.removeEventListener(WI.CSSStyleDeclaration.Event.PropertiesChanged, styleDecorationUpdated); > resolve(); > } >- ++updateCount; > } > > WI.CSSStyleDeclaration.addEventListener(WI.CSSStyleDeclaration.Event.PropertiesChanged, styleDecorationUpdated); >@@ -112,6 +109,6 @@ function test() { > </head> > <body onload="runTest()"> > <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> >- <div id="x" style="height: 42px"></div> >+ <div id="x" style="height: 10px"></div> > </body> > </html> >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index d9f248038f2..c7a137d32e3 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-05 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty >+ https://bugs.webkit.org/show_bug.cgi?id=194318 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Previously, WI.CSSStyleDeclaration.Event.PropertiesChanged fired when >+ old text and new text were empty strings. >+ >+ * UserInterface/Models/CSSStyleDeclaration.js: >+ > 2019-02-05 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Styles: remove harmless "property was unlocked" asserts >diff --git a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >index 6d06c8a7d23..429a0fa9c3b 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >+++ b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >@@ -173,8 +173,7 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > if (dontFireEvents) > return; > >- // Don't fire the event if there is text and it hasn't changed. >- if (oldText && this._text && oldText === this._text) >+ if (oldText === this._text) > return; > > function delayed()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
hi
:
review+
hi
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194318
:
361249
|
361260
|
361262