Steps: 1. Open https://twitter.com (either logged in or not) 2. Inspect <body> 3. In the Styles sidebar, find "body {margin-top: 0px;}" 4. Click on "margin-top" to start editing Editing doesn't start. The rule appears read-only for no apparent reason. Note that the other body's CSS rules are editable.
<rdar://problem/70533893>
When clicking on "margin-top": [Error] TypeError: null is not an object (evaluating 'this._styleSheetTextRange.collapseToEnd') _rangeAfterPropertyAtIndex (CSSStyleDeclaration.js:547) newBlankProperty (CSSStyleDeclaration.js:412) addBlankProperty (SpreadsheetCSSStyleDeclarationEditor.js:326) _handleClick (SpreadsheetCSSStyleDeclarationSection.js:608) _handleClick
In Twitter HTML, I see this: ``` <style> html, body { height: 100%; } body { -ms-overflow-style: scrollbar; overflow-y: scroll; overscroll-behavior-y: none; } </style> <style id="react-native-stylesheet"> [stylesheet-group="0"] { } html { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { margin: 0; } ``` Everything in the 1st <style> element is editable just fine. Everything in the 2nd is not. This CSSStyleDeclaration instance doesn't have `this._styleSheetTextRange` yet it has this.ownerStyleSheet. That's very odd.
None of these work: https://reactnative.dev/docs/stylesheet This must have impacted many websites. Investigating how React Native constructs stylesheets. My guess would be that it uses CSSOM.
*** Bug 218297 has been marked as a duplicate of this bug. ***
Created attachment 413201 [details] [HTML] Reduction
Created attachment 413202 [details] [HTML] Reduction
Created attachment 413205 [details] WIP This diff has front-end changes necessary to make CSS properties editable. However, I discovered that the backend part is broken, too :( ``` <style id="style_element"></style> <script> style_element.sheet.insertRule("body {color: green}", 0); </script> ``` With this WIP applied, inspect <body> and change the color from "green" to "blue". The following error will happen: [Error] Error saving style: – "NotFoundError" styleTextDidChange (CSSStyleDeclaration.js:238) The error is coming from the backend. Specifically, `target.CSSAgent.setStyleText(style.id, text, didSetStyleText)` can't seem to be able to find and update dynamically created styles.