Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Issue 985533002: Set up serving infrastructure for c/b/r/settings. (Closed)

Created:
5 years, 9 months ago by Jeremy Klein
Modified:
5 years, 9 months ago
CC:
chromium-reviews, arv+watch_chromium.org, Dan Beam, dfreedm1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Set up serving infrastructure for c/b/r/settings. BUG= Committed: https://crrev.com/794e9820dc79d9c94734e87ed73f7a46faa15666 Cr-Commit-Position: refs/heads/master@{#319512}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Clean some things up #

Total comments: 2

Patch Set 3 : Fix copyright header comment style. #

Patch Set 4 : Fix line length in grd. #

Patch Set 5 : Fix some gn issues. #

Patch Set 6 : Respond to michaelpg's comments. #

Patch Set 7 : Address a couple style comments. #

Patch Set 8 : Remove unrelated changes #

Total comments: 2

Patch Set 9 : Move demo script tag to head. #

Patch Set 10 : Wait for onload. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -8 lines) Patch
M chrome/BUILD.gn View 1 2 3 4 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/resources/BUILD.gn View 1 2 3 4 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/a11y_page/a11y_page.js View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/resources/settings/a11y_page/demo.html View 1 2 3 4 5 6 7 8 1 chunk +1 line, -4 lines 0 comments Download
A chrome/browser/resources/settings/a11y_page/demo.js View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 3 comments Download
A chrome/browser/resources/settings/settings_resources.grd View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/md_settings_ui.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_repack_resources.gypi View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/chrome_resources.gyp View 1 chunk +8 lines, -0 lines 0 comments Download
M tools/gritsettings/resource_ids View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (6 generated)
Jeremy Klein
https://codereview.chromium.org/985533002/diff/1/tools/gritsettings/resource_ids File tools/gritsettings/resource_ids (right): https://codereview.chromium.org/985533002/diff/1/tools/gritsettings/resource_ids#newcode249 tools/gritsettings/resource_ids:249: "structures": [30900], What happens when we run out of ...
5 years, 9 months ago (2015-03-06 00:09:30 UTC) #1
Jeremy Klein
This CL causes everything under chrome/browser/resources/settings to be served to chrome://md-settings/* as long as it's ...
5 years, 9 months ago (2015-03-06 00:14:08 UTC) #3
Dan Beam
drive-by https://codereview.chromium.org/985533002/diff/20001/chrome/browser/resources/settings/a11y_page/demo.js File chrome/browser/resources/settings/a11y_page/demo.js (right): https://codereview.chromium.org/985533002/diff/20001/chrome/browser/resources/settings/a11y_page/demo.js#newcode3 chrome/browser/resources/settings/a11y_page/demo.js:3: * found in the LICENSE file. */ .js ...
5 years, 9 months ago (2015-03-06 00:53:24 UTC) #4
Jeremy Klein
https://codereview.chromium.org/985533002/diff/20001/chrome/browser/resources/settings/a11y_page/demo.js File chrome/browser/resources/settings/a11y_page/demo.js (right): https://codereview.chromium.org/985533002/diff/20001/chrome/browser/resources/settings/a11y_page/demo.js#newcode3 chrome/browser/resources/settings/a11y_page/demo.js:3: * found in the LICENSE file. */ On 2015/03/06 ...
5 years, 9 months ago (2015-03-06 01:44:57 UTC) #5
michaelpg
fwiw, LGTM *but* I don't have a good understanding of how this stuff works :-) ...
5 years, 9 months ago (2015-03-06 02:08:17 UTC) #6
Jeremy Klein
https://codereview.chromium.org/985533002/diff/1/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/985533002/diff/1/chrome/browser/resources/settings/prefs/prefs.js#newcode78 chrome/browser/resources/settings/prefs/prefs.js:78: /** On 2015/03/06 02:08:17, michaelpg wrote: > Looks like ...
5 years, 9 months ago (2015-03-06 02:20:01 UTC) #7
stevenjb
The changes to prefs.js and cr_dropdown_menu.js seem unrelated and should be committed separately. Otherwise lgtm.
5 years, 9 months ago (2015-03-06 18:03:52 UTC) #8
Jeremy Klein
On 2015/03/06 18:03:52, stevenjb wrote: > The changes to prefs.js and cr_dropdown_menu.js seem unrelated and ...
5 years, 9 months ago (2015-03-06 18:25:13 UTC) #9
James Hawkins
https://codereview.chromium.org/985533002/diff/140001/chrome/browser/resources/settings/a11y_page/demo.html File chrome/browser/resources/settings/a11y_page/demo.html (right): https://codereview.chromium.org/985533002/diff/140001/chrome/browser/resources/settings/a11y_page/demo.html#newcode10 chrome/browser/resources/settings/a11y_page/demo.html:10: <script src="demo.js"></script> Is this required to be in the ...
5 years, 9 months ago (2015-03-06 18:44:12 UTC) #10
Jeremy Klein
https://codereview.chromium.org/985533002/diff/140001/chrome/browser/resources/settings/a11y_page/demo.html File chrome/browser/resources/settings/a11y_page/demo.html (right): https://codereview.chromium.org/985533002/diff/140001/chrome/browser/resources/settings/a11y_page/demo.html#newcode10 chrome/browser/resources/settings/a11y_page/demo.html:10: <script src="demo.js"></script> On 2015/03/06 18:44:12, James Hawkins wrote: > ...
5 years, 9 months ago (2015-03-06 18:48:33 UTC) #11
James Hawkins
lgtm
5 years, 9 months ago (2015-03-06 18:50:53 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/985533002/160001
5 years, 9 months ago (2015-03-06 18:52:19 UTC) #15
michaelpg
https://codereview.chromium.org/985533002/diff/180001/chrome/browser/resources/settings/a11y_page/demo.js File chrome/browser/resources/settings/a11y_page/demo.js (right): https://codereview.chromium.org/985533002/diff/180001/chrome/browser/resources/settings/a11y_page/demo.js#newcode8 chrome/browser/resources/settings/a11y_page/demo.js:8: window.onload = function() { I believe it's more "correct" ...
5 years, 9 months ago (2015-03-06 20:25:59 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/985533002/180001
5 years, 9 months ago (2015-03-06 20:31:55 UTC) #20
Jeremy Klein
https://codereview.chromium.org/985533002/diff/180001/chrome/browser/resources/settings/a11y_page/demo.js File chrome/browser/resources/settings/a11y_page/demo.js (right): https://codereview.chromium.org/985533002/diff/180001/chrome/browser/resources/settings/a11y_page/demo.js#newcode8 chrome/browser/resources/settings/a11y_page/demo.js:8: window.onload = function() { On 2015/03/06 20:25:59, michaelpg wrote: ...
5 years, 9 months ago (2015-03-06 21:33:56 UTC) #21
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 9 months ago (2015-03-06 21:43:51 UTC) #22
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/794e9820dc79d9c94734e87ed73f7a46faa15666 Cr-Commit-Position: refs/heads/master@{#319512}
5 years, 9 months ago (2015-03-06 21:44:27 UTC) #23
michaelpg
@dfreedm, is this something you could help us with for future reference? We're not sure ...
5 years, 9 months ago (2015-03-06 22:33:49 UTC) #24
dfreedm1
That's a good question. Each element has it's own version of "ready" as a callback ...
5 years, 9 months ago (2015-03-06 22:50:37 UTC) #25
chromium-reviews
`element.ready`: all the elements inside an element's shadowRoot are ready so this is a good ...
5 years, 9 months ago (2015-03-06 23:31:57 UTC) #26
michaelpg
5 years, 9 months ago (2015-03-08 05:55:41 UTC) #27
Message was sent while issue was closed.
Thanks, Steve. Sorry my questions were a bit confusing.

My main question is: is it OK to update a published property on an element
before that element has been upgraded?

For instance, if myIcon represents a <core-icon> in the outermost document,
is it safe to do "myIcon.src = newSrc;" as soon as window.onload fires, and
expect the <core-icon>'s srcChanged to be called? Or should I wait for
polymer-ready to fire? Example script here. <http://pastebin.com/yt7zUamH>

The second, unrelated question was whether polymer-ready always fires after
window.onload, or if polymer-ready could fire before the whole DOM is ready.

Thanks,
Michael

On Fri, Mar 6, 2015 at 3:31 PM, Steve Orvell <sorvell@google.com> wrote:

> `element.ready`: all the elements inside an element's shadowRoot are ready
> so this is a good time to manipulate them, if necessary.
>
> `element.domReady`: all the elements in the dom tree in which the element
> exists that can upgrade have done so; it's safe to perform work on a parent
> or child, for example.
>
> `polymer-ready` event / `Polymer.whenReady`: all elements that have been
> imported have been registered and as a consequence any existing elements
> have been upgraded.
>
>
>
> On Fri, Mar 6, 2015 at 2:50 PM, Daniel Freedman <dfreedm@chromium.org>
> wrote:
>
>> That's a good question.
>>
>> Each element has it's own version of "ready" as a callback (named
>> domReady), that is called when the subtree for that element is set up.
>> The "polymer-ready" event is fired when all element subtrees have reached
>> the "domReady" callback state.
>>
>> @sorvell, are there any other spots they can use with 0.5 elements?
>>
>>
>>
>> On Fri, Mar 6, 2015 at 2:33 PM, <michaelpg@chromium.org> wrote:
>>
>>> @dfreedm, is this something you could help us with for future reference?
>>>
>>> We're not sure whether it's 1. necessary and 2. sufficient to wait for
>>> "polymer-ready" before setting properties on Polymer elements. I
>>> couldn't find a
>>> great answer in the Polymer docs, sorry if it's there somewhere.
>>>
>>> 1. Do we need to wait for the element to be upgraded before setting
>>> properties
>>> that are listed in the publish block?
>>>
>>> 2. Is the DOM itself guaranteed to be ready before "polymer-ready" is
>>> fired?
>>>
>>> Thanks!
>>>
>>>
>>> https://codereview.chromium.org/985533002/diff/180001/
>>> chrome/browser/resources/settings/a11y_page/demo.js
>>> File chrome/browser/resources/settings/a11y_page/demo.js (right):
>>>
>>> https://codereview.chromium.org/985533002/diff/180001/
>>> chrome/browser/resources/settings/a11y_page/demo.js#newcode8
>>> chrome/browser/resources/settings/a11y_page/demo.js:8: window.onload =
>>> function() {
>>> On 2015/03/06 21:33:56, Jeremy Klein wrote:
>>>
>>>> On 2015/03/06 20:25:59, michaelpg wrote:
>>>> > I believe it's more "correct" to use
>>>>
>>> window.addEventListener('polymer-ready',
>>>
>>>> > ...) to ensure the elements have been registered.
>>>>
>>>
>>>  This isn't really necessary in this case because the script here
>>>>
>>> doesn't depend
>>>
>>>> on any of the Polymer elements being upgraded, just that the DOM is
>>>>
>>> loaded.
>>>
>>> Data binding seems to work, but apparently it's not going through all
>>> the motions. If the element hasn't been upgraded, setting page.prefs
>>> just sets that property (which is all the page needs for data binding to
>>> start kicking in).
>>>
>>> Once the element has been upgraded, setting page.prefs would cause
>>> changed watchers to be called, updates page.prefs_, and whatever else
>>> Polymer does under the hood. If the attribute were reflected, the
>>> reflection wouldn't happen. So all of that doesn't happen if the element
>>> hasn't been upgraded yet. I don't know whether there's a guarantee in
>>> terms of what will work and what won't.
>>>
>>>  Also, do you know if polymer-ready is guaranteed to fire *after*
>>>>
>>> window.onload?
>>>
>>>> I know that it will probably almost always be true, but I'm not sure
>>>>
>>> there's a
>>>
>>>> guarantee there. If we got into a state where the polymer-ready fired
>>>>
>>> before
>>>
>>>> window.onload, we'd still hit errors in here.
>>>>
>>>
>>> I can't find that guarantee. But could polymer-ready be fired without
>>> the DOM? My understanding is it can only be fired once all
>>> polymer-element declarations have been executed. Can it ensure that
>>> before it's queried the entire DOM tree?
>>>
>>>
>>>  I'll change it if you feel really strongly about it, but I think for a
>>>>
>>> demo that
>>>
>>>> isn't actually relying on polymer elements being fully registered,
>>>>
>>> this doesn't
>>>
>>>> matter much.
>>>>
>>>
>>> I agree it doesn't matter much, if it's committed and it works. I
>>> thought it's worth pointing out, since when I reviewed this initially I
>>> figured it would work then too. Just trying to be thorough.
>>>
>>> https://codereview.chromium.org/985533002/revert
>>>
>>
>>
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698