RESOLVED FIXED 101841
Web Inspector: migrate text editor to mutation observers
https://bugs.webkit.org/show_bug.cgi?id=101841
Summary Web Inspector: migrate text editor to mutation observers
Pavel Feldman
Reported 2012-11-10 10:04:14 PST
Otherwise, we miss notifications on the removed lines.
Attachments
Patch (6.33 KB, patch)
2012-11-10 10:07 PST, Pavel Feldman
no flags
Patch (12.52 KB, patch)
2012-11-10 23:06 PST, Pavel Feldman
no flags
Patch (15.16 KB, patch)
2012-11-11 05:52 PST, Pavel Feldman
no flags
Patch (15.66 KB, patch)
2012-11-12 05:03 PST, Pavel Feldman
no flags
[Patch] for landing (17.57 KB, patch)
2012-11-13 00:31 PST, Pavel Feldman
vsevik: review+
Pavel Feldman
Comment 1 2012-11-10 10:07:56 PST
Pavel Feldman
Comment 2 2012-11-10 23:06:18 PST
Pavel Feldman
Comment 3 2012-11-11 05:52:09 PST
Vsevolod Vlasov
Comment 4 2012-11-12 03:50:14 PST
Comment on attachment 173501 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=173501&action=review > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2080 > + if (false) // For paint debugging. Maybe add a debug flag at the top of this file? > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2317 > + // console.log(this.element.innerText === this._textModel.text() + "\n"); Ditto
Pavel Feldman
Comment 5 2012-11-12 05:03:50 PST
Vsevolod Vlasov
Comment 6 2012-11-12 05:10:33 PST
Comment on attachment 173626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=173626&action=review > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2147 > + if (mutation.addedNodes.length === 1 && mutation.addedNodes[0].nodeName === "BR") remove br check? > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2211 > // Ensure that the newly inserted line row has no lineNumber. Shouldn't it be assert?
Andrey Adaikin
Comment 7 2012-11-12 05:27:35 PST
Comment on attachment 173626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=173626&action=review >> Source/WebCore/inspector/front-end/DefaultTextEditor.js:2211 >> // Ensure that the newly inserted line row has no lineNumber. > > Shouldn't it be assert? This is to remove the lineNumber property from a line row being detached from the DOM, as it may be (and will be) cached for a future reuse, and we don't ever want to reuse it with a wrong lineNumber attribute.
Andrey Adaikin
Comment 8 2012-11-12 05:31:38 PST
Comment on attachment 173626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=173626&action=review >>> Source/WebCore/inspector/front-end/DefaultTextEditor.js:2211 >>> // Ensure that the newly inserted line row has no lineNumber. >> >> Shouldn't it be assert? > > This is to remove the lineNumber property from a line row being detached from the DOM, as it may be (and will be) cached for a future reuse, and we don't ever want to reuse it with a wrong lineNumber attribute. ah we insert a line row here, I missed this... I guess we can get wrong lineNumbers after a drag'n'drop of a peace of code in the editor from one place to another.
Andrey Adaikin
Comment 9 2012-11-12 05:34:24 PST
Comment on attachment 173626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=173626&action=review > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2080 > + if (false) // For paint debugging. remove? > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2186 > + // Debug check for validating whether text model matches the DOM representation. meant to leave this comment? > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2320 > // This is a "foreign" call outside of this class. Should be before we delete the dirty lines flag. this comment is no longer valid
Pavel Feldman
Comment 10 2012-11-12 06:35:29 PST
WebKit Review Bot
Comment 11 2012-11-12 08:10:05 PST
Re-opened since this is blocked by bug 101939
Pavel Feldman
Comment 12 2012-11-13 00:31:42 PST
Created attachment 173841 [details] [Patch] for landing
Pavel Feldman
Comment 13 2012-11-13 00:35:08 PST
Csaba Osztrogonác
Comment 14 2012-11-13 02:10:57 PST
Csaba Osztrogonác
Comment 15 2012-11-13 02:13:29 PST
It seems the root of the problem is that mutation observers is disabled on Qt. Is there a reason why is it disabled?
Note You need to log in before you can comment on or make changes to this bug.