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

Issue 1246633007: Check that processed i18n nodes are defined before marking them. (Closed)

Created:
5 years, 5 months ago by kkhorimoto
Modified:
5 years, 5 months ago
Reviewers:
Dan Beam, Jackie Quinn
CC:
chromium-reviews, oshima+watch_chromium.org, esprehn
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Check that processed i18n nodes are defined before marking them. On iOS, |root.children| was undefined for IDR_NET_ERROR_HTML webui, which prevented the further conversion of i18n nodes. BUG=512085 Committed: https://crrev.com/b46a8bb14f620471292c2ce4c12e7694c9fd7595 Cr-Commit-Position: refs/heads/master@{#339792}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M ui/webui/resources/js/i18n_template_no_process.js View 1 chunk +4 lines, -2 lines 2 comments Download

Messages

Total messages: 10 (2 generated)
kkhorimoto
This fixes a bug introduced in https://codereview.chromium.org/1233883005/, and described in crbug.com/512085. For the error page ...
5 years, 5 months ago (2015-07-21 21:21:45 UTC) #2
Dan Beam
https://codereview.chromium.org/1246633007/diff/1/ui/webui/resources/js/i18n_template_no_process.js File ui/webui/resources/js/i18n_template_no_process.js (right): https://codereview.chromium.org/1246633007/diff/1/ui/webui/resources/js/i18n_template_no_process.js#newcode187 ui/webui/resources/js/i18n_template_no_process.js:187: if (processed) { I'm confused. if ([]) always triggers. ...
5 years, 5 months ago (2015-07-21 21:26:21 UTC) #3
Dan Beam
On 2015/07/21 21:21:45, kkhorimoto_ wrote: > This fixes a bug introduced in https://codereview.chromium.org/1233883005/, and > ...
5 years, 5 months ago (2015-07-21 21:28:18 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1246633007/1
5 years, 5 months ago (2015-07-21 21:35:14 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 5 months ago (2015-07-22 00:12:29 UTC) #7
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/b46a8bb14f620471292c2ce4c12e7694c9fd7595 Cr-Commit-Position: refs/heads/master@{#339792}
5 years, 5 months ago (2015-07-22 00:13:21 UTC) #8
Dan Beam
https://codereview.chromium.org/1246633007/diff/1/ui/webui/resources/js/i18n_template_no_process.js File ui/webui/resources/js/i18n_template_no_process.js (right): https://codereview.chromium.org/1246633007/diff/1/ui/webui/resources/js/i18n_template_no_process.js#newcode186 ui/webui/resources/js/i18n_template_no_process.js:186: var processed = isElement ? [root] : root.children; fwiw: ...
5 years, 5 months ago (2015-07-22 00:20:40 UTC) #9
Dan Beam
5 years, 5 months ago (2015-07-22 00:21:16 UTC) #10
Message was sent while issue was closed.
On 2015/07/22 00:20:40, Dan Beam wrote:
>
https://codereview.chromium.org/1246633007/diff/1/ui/webui/resources/js/i18n_...
> File ui/webui/resources/js/i18n_template_no_process.js (right):
> 
>
https://codereview.chromium.org/1246633007/diff/1/ui/webui/resources/js/i18n_...
> ui/webui/resources/js/i18n_template_no_process.js:186: var processed =
isElement
> ? [root] : root.children;
> fwiw: this would probably work on iOS as well
> 
>   var processed = isElement ? [root] : root.childNodes;
>   for (var i = 0; i < process.length; ++i) {
>     if (processed.nodeType == Node.ELEMENT_NODE)

if (processed[i].nodeType == Node.ELEMENT_NODE) **

>       processed[i].setAttribute('i18n-processed', '');
>   }
> 
> or just
> 
>     if (processed instanceof Element)

if (processed[i] instanceof Element) **

Powered by Google App Engine
This is Rietveld 408576698