-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Use styleSheetAdded and styleSheetRemoved, replaces getAllStylesheets #7008
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since getStylesheetURLs depended on getAllStylesheets, most of this code now moves into the styleSheetAdded event handler.
|
Doh. I just realized that we should check for the original API in case the user is using an older version of Chrome. |
|
Added fallback for Even though Chrome 33 should support both, I found that the |
|
Somewhat related to these changes is PR #7010 to update the inspector protocol to the latest stable version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this dump out an error in the console if the API doesn't exist? I wonder if we should bother doing this, since the events seem to have been around for awhile, and I don't think we need to support people who don't regularly update Chrome. (Although I guess we don't know exactly which version they were introduced in.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will yes. We can suppress a subset of protocol errors, particularly this one where the method is not defined. The basic set of error codes are defined here http://www.jsonrpc.org/specification#error_object. I can't find any documentation for Chrome that defines implementation-specific error codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow enable during LiveDevelopment _onInterstitialPageLoad(). The old behavior would wait all the way until loadEventFired to enable the CSS domain. This also allows loadAgents() to complete faster since we no longer wait for the sequence of (1) loadEventFired, (2) enable and (3) getAllStylesheets.
|
I'm seeing the this LiveDevelopment unit test fail every time on Win7 (both HD and SSD) and Chrome 33: "should reload the page when editing a non-live document" UPDATE: seeing same failure with Win7 (SSD) with Chrome 34.0.1847.11 beta-m. |
|
FYI, Win7 (HD) with Chrome 35 (canary) is a train wreck (7 of 9 fail). Getting "External Changes: simple1.css has been modified on disk, but also has unsaved changes in Brackets" warning dialog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since code no longer checks if (_urlToStyle) then _urlToStyle should be initialized to _urlToStyle = {} on line 43 to be safe. Same for _styleSheetIdToUrl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
There are a lot of conflicts with PR #6889 -- should these be merged? |
…interim updates cause spurious added/removed events.
|
@redmunds Looking at the unit test failures now. Will send an update later today. |
…ackets into jasonsanjose/issue-6830
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer necessary to check for existence of _urlToStyle object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
@redmunds let me know if you see a unit test failure at the end of the live dev suite due to |
|
@jasonsanjose Yes, I just saw it on Win7 (SSD) but not on Win7 (HD). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems out-of-place since the 2 things listed are not done here. The one item that is done here ("agent loading") was removed from the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Removed the whole thing.
|
@jasonsanjose I tried to manually delete the test/temp folder and got the message: "The action can't be completed because the folder or file is open in another program". I shutdown Brackets and could then remove the folder. Now the tests pass. Interesting because I know that I had a clean |
…ackets into jasonsanjose/issue-6830
|
@redmunds cleaned up those last few comments. Still no luck with the |
|
@jasonsanjose Do you have a repeatable recipe for the |
|
Unfortunately no. It happens about 90% of the time I run the live dev test suite. |
|
I'm getting an exception in HighlightAgent unit test on Win7 (SSD) with Chrome 33: should redraw highlights when the document changes |
|
@redmunds fixed the HighlightAgent test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the path null if it's not an external stylesheet (i.e. embedded) ?
|
@jasonsanjose I can still hit the But, we need to get this in master so people start using it. We also need to figure out which pieces of #6889 we need to take. Merging. |
Use styleSheetAdded and styleSheetRemoved, replaces getAllStylesheets
Fix for #6830
styleSheetAddedandstyleSheetRemovedevent handling to inspector protocolgetAllStylesheetsfor Chrome < 34Fix for #6912
styleSheetAddedto keepstyleSheetIdvalues up to date to fix "No style sheet with given id found, code: -32000" when pushing change events from Brackets to Chrome