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

Issue 313173012: HTMLParser should use current value of scriptEnabled flag (Closed)

Created:
6 years, 6 months ago by mmal
Modified:
6 years, 5 months ago
CC:
arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@WebKit-ADD
Visibility:
Public.

Description

HTMLParser should use current value of scriptEnabled flag This CL adds caching of scriptEnabled setting to Document. When page is reloaded we create new parser throught DocumentLoader::ensureWriter and set scriptEnabled flag. ContentSettingsObserver::allowScript method is responsible for checking settings but it uses cache. Cache is cleared on DidCommitProvisionalLoad but parser is already created before that. However we can't clear cache earlier because unload events for old page might be fired and it depends on old page settings (cached). BUG=232410 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177664

Patch Set 1 : New approach #

Total comments: 6

Patch Set 2 : #

Patch Set 3 : lazy init #

Patch Set 4 : Rebase #

Patch Set 5 : Tests fix - make use of window.open() #

Total comments: 1

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -13 lines) Patch
M LayoutTests/fast/harness/override-preferences.html View 1 2 3 4 5 1 chunk +7 lines, -3 lines 0 comments Download
A LayoutTests/fast/harness/resources/override-preferences-window.html View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/xsl/resources/xslt-transform-with-javascript-disabled-mainframe.html View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/xsl/xslt-transform-with-javascript-disabled.html View 1 2 3 4 5 1 chunk +12 lines, -8 lines 0 comments Download
M Source/bindings/core/v8/ScriptController.cpp View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (0 generated)
mmal
6 years, 6 months ago (2014-06-05 13:51:59 UTC) #1
jochen (gone - plz use gerrit)
+adam/eric for parser
6 years, 6 months ago (2014-06-05 13:59:35 UTC) #2
abarth-chromium
https://codereview.chromium.org/313173012/diff/1/Source/bindings/v8/ScriptController.h File Source/bindings/v8/ScriptController.h (right): https://codereview.chromium.org/313173012/diff/1/Source/bindings/v8/ScriptController.h#newcode67 Source/bindings/v8/ScriptController.h:67: AboutToParseHTML not lgtm It's not sensible to add this ...
6 years, 6 months ago (2014-06-06 17:21:13 UTC) #3
abarth-chromium
Also, your CL is missing tests.
6 years, 6 months ago (2014-06-06 17:21:34 UTC) #4
mmal
On 2014/06/06 17:21:13, abarth wrote: > https://codereview.chromium.org/313173012/diff/1/Source/bindings/v8/ScriptController.h > File Source/bindings/v8/ScriptController.h (right): > > https://codereview.chromium.org/313173012/diff/1/Source/bindings/v8/ScriptController.h#newcode67 > ...
6 years, 6 months ago (2014-06-11 10:28:00 UTC) #5
abarth-chromium
On 2014/06/11 at 10:28:00, mmaliszkiewicz wrote: > Problem is that permission for executing scripts is ...
6 years, 6 months ago (2014-06-11 19:34:54 UTC) #6
abarth-chromium
From the description, this sounds like a bug in the embedder. We're asking whether script ...
6 years, 6 months ago (2014-06-11 19:35:38 UTC) #7
mmal
On 2014/06/11 19:35:38, abarth wrote: > From the description, this sounds like a bug in ...
6 years, 6 months ago (2014-06-12 11:53:49 UTC) #8
mmal
> a) page be is being parsed and asks ScriptController about script execution, > and ...
6 years, 6 months ago (2014-06-12 11:55:53 UTC) #9
abarth-chromium
So, the intent of the setting is that it takes effect on the next page ...
6 years, 6 months ago (2014-06-13 03:03:34 UTC) #10
eseidel
https://codereview.chromium.org/313173012/diff/1/Source/core/html/parser/HTMLParserOptions.cpp File Source/core/html/parser/HTMLParserOptions.cpp (right): https://codereview.chromium.org/313173012/diff/1/Source/core/html/parser/HTMLParserOptions.cpp#newcode40 Source/core/html/parser/HTMLParserOptions.cpp:40: scriptEnabled = frame && frame->script().canExecuteScripts(AboutToParseHTML); I agree with abarth. ...
6 years, 6 months ago (2014-06-17 21:24:08 UTC) #11
mmal
On 2014/06/17 21:24:08, eseidel wrote: > https://codereview.chromium.org/313173012/diff/1/Source/core/html/parser/HTMLParserOptions.cpp > File Source/core/html/parser/HTMLParserOptions.cpp (right): > > https://codereview.chromium.org/313173012/diff/1/Source/core/html/parser/HTMLParserOptions.cpp#newcode40 > ...
6 years, 6 months ago (2014-06-18 14:01:46 UTC) #12
abarth-chromium
On 2014/06/18 at 14:01:46, mmaliszkiewicz wrote: > Couldn't cache be held inside ScriptController? I need ...
6 years, 6 months ago (2014-06-18 23:39:39 UTC) #13
abarth-chromium
6 years, 6 months ago (2014-06-18 23:39:43 UTC) #14
mmal
How about this approach?
6 years, 6 months ago (2014-06-26 18:34:48 UTC) #15
abarth-chromium
This approach is great! Some minor questions below. https://codereview.chromium.org/313173012/diff/20001/Source/core/dom/ExecutionContext.cpp File Source/core/dom/ExecutionContext.cpp (right): https://codereview.chromium.org/313173012/diff/20001/Source/core/dom/ExecutionContext.cpp#newcode67 Source/core/dom/ExecutionContext.cpp:67: , ...
6 years, 6 months ago (2014-06-26 19:53:37 UTC) #16
mmal
https://codereview.chromium.org/313173012/diff/20001/Source/core/dom/ExecutionContext.cpp File Source/core/dom/ExecutionContext.cpp (right): https://codereview.chromium.org/313173012/diff/20001/Source/core/dom/ExecutionContext.cpp#newcode67 Source/core/dom/ExecutionContext.cpp:67: , m_scriptEnabled(false) On 2014/06/26 19:53:37, abarth wrote: > What ...
6 years, 5 months ago (2014-06-27 19:39:16 UTC) #17
abarth-chromium
On 2014/06/27 at 19:39:16, mmaliszkiewicz wrote: > WorkerGlobalScope seems to have its own WorkerScriptController. Only ...
6 years, 5 months ago (2014-06-27 20:18:40 UTC) #18
mmal
6 years, 5 months ago (2014-06-30 14:46:33 UTC) #19
abarth-chromium
Perfect! LGTM
6 years, 5 months ago (2014-06-30 17:57:30 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mmaliszkiewicz@opera.com/313173012/60001
6 years, 5 months ago (2014-06-30 17:58:54 UTC) #21
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 5 months ago (2014-06-30 19:03:39 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-06-30 19:29:05 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/14150)
6 years, 5 months ago (2014-06-30 19:29:05 UTC) #24
mmal
On 2014/06/30 19:29:05, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 5 months ago (2014-07-04 11:45:38 UTC) #25
abarth-chromium
On 2014/07/04 at 11:45:38, mmaliszkiewicz wrote: > On 2014/06/30 19:29:05, I haz the power (commit-bot) ...
6 years, 5 months ago (2014-07-04 15:31:40 UTC) #26
abarth-chromium
https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/14150/layout-test-results/results.html
6 years, 5 months ago (2014-07-04 15:32:01 UTC) #27
mmal
On 2014/07/04 15:32:01, abarth wrote: > https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/14150/layout-test-results/results.html These tests are disabling javascript through javascript, we ...
6 years, 5 months ago (2014-07-04 19:35:26 UTC) #28
abarth-chromium
On 2014/07/04 at 19:35:26, mmaliszkiewicz wrote: > On 2014/07/04 15:32:01, abarth wrote: > > https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/14150/layout-test-results/results.html ...
6 years, 5 months ago (2014-07-04 19:48:06 UTC) #29
mmal
On 2014/07/04 19:48:06, abarth wrote: > On 2014/07/04 at 19:35:26, mmaliszkiewicz wrote: > > On ...
6 years, 5 months ago (2014-07-04 19:50:30 UTC) #30
mmal
I deleted last tests fix (btw: there are tests which try to enable javascript through ...
6 years, 5 months ago (2014-07-07 20:05:45 UTC) #31
abarth-chromium
LGTM https://codereview.chromium.org/313173012/diff/200001/LayoutTests/fast/harness/override-preferences.html File LayoutTests/fast/harness/override-preferences.html (right): https://codereview.chromium.org/313173012/diff/200001/LayoutTests/fast/harness/override-preferences.html#newcode14 LayoutTests/fast/harness/override-preferences.html:14: win.onload = function(){testRunner.notifyDone()}; win.onload = function() { testRunner.notifyDone() ...
6 years, 5 months ago (2014-07-07 20:31:05 UTC) #32
mmal
The CQ bit was checked by mmaliszkiewicz@opera.com
6 years, 5 months ago (2014-07-08 11:27:28 UTC) #33
mmal
6 years, 5 months ago (2014-07-08 11:27:32 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mmaliszkiewicz@opera.com/313173012/220001
6 years, 5 months ago (2014-07-08 11:27:33 UTC) #35
commit-bot: I haz the power
Change committed as 177664
6 years, 5 months ago (2014-07-08 12:33:23 UTC) #36
Yuta Kitamura
A revert of this CL has been created in https://codereview.chromium.org/375263002/ by yutak@chromium.org. The reason for ...
6 years, 5 months ago (2014-07-09 09:20:43 UTC) #37
mmal
6 years, 5 months ago (2014-07-09 13:51:17 UTC) #38
Message was sent while issue was closed.
On 2014/07/09 09:20:43, Yuta Kitamura wrote:
> A revert of this CL has been created in
> https://codereview.chromium.org/375263002/ by mailto:yutak@chromium.org.
> 
> The reason for reverting is: This patch *appears* to break AwSettingsTest and
> AwContentsClientShouldOverrideUrlLoadingTest:
> http://build.chromium.org/p/chromium.webkit/builders/Android%20Tests%20(dbg)
> 
> This is my wild guess but it might be possible
> that this patch is the cause, since the tests in
> question call setJavaScriptEnabled(true).
> 
> Apologies if my guess is wrong. I'll revert the
> revert if it turned out that I'm wrong..

Most likely you are right. Are only tests broken or some functionality as well?
I think main difference about this patch is that now you can't change document's
javascript on/off state without recreating the document (i.e. by reloading the
page). This behavior is closer to what browser actually do but previously it was
done in chromium layer so WebKit tests simply didn't take it into account.

I'm not familiar with Android tests, could you try to repair it? If they use
javascript then you can rewrite it in a manner I dealt with LayoutTests.

Powered by Google App Engine
This is Rietveld 408576698