Chromium Code Reviews

Issue 161383002: Disabling JavaScript in MHTML and limiting MHTML loading to top frames. (Closed)

Created:
6 years, 10 months ago by Jay Civelli
Modified:
6 years, 9 months ago
Reviewers:
Hajime Morrita, jschuh, abarth-chromium
CC:
blink-reviews, Nate Chapin, gavinp+loader_chromium.org
Visibility:
Public.

Description

Restricts MHTML loading to top frames. Also disabling JavaScript for MHTML documents. Because JavaScipt is now disabled, MHTML layout tests had to be changed not to use JavaScript anymore. BUG=330663 TEST=Run MHTML layout tests. R=abarth@chromium.org, jschuh@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169499

Patch Set 1 #

Patch Set 2 : Removed check_domain.mht (replaced with relative_url.mht) #

Total comments: 2

Patch Set 3 : Switching to using enforceSandboxFlags instead of using the settings which are persistent. #

Patch Set 4 : Last upload seemed confused #

Total comments: 1

Patch Set 5 : Moving enforceSandboxFlags to maybeCreateArchive #

Patch Set 6 : Synced #

Patch Set 7 : Upload again #

Patch Set 8 : Synced #

Patch Set 9 : Synced #

Patch Set 10 : Removing CRLF terminated file (moved to different patch) to fix trybots. #

Patch Set 11 : Synced #

Patch Set 12 : Synced #

Unified diffs Side-by-side diffs Stats (+472 lines, -574 lines)
D LayoutTests/mhtml/base_url.mht View 1 chunk +0 lines, -30 lines 0 comments
D LayoutTests/mhtml/base_url-expected.txt View 1 chunk +0 lines, -1 line 0 comments
D LayoutTests/mhtml/check_domain.mht View 1 chunk +0 lines, -45 lines 0 comments
D LayoutTests/mhtml/check_domain-expected.txt View 1 chunk +0 lines, -4 lines 0 comments
M LayoutTests/mhtml/content_transfer_encoding_none.mht View 1 chunk +1 line, -6 lines 0 comments
A LayoutTests/mhtml/content_transfer_encoding_none-expected.html View 1 chunk +10 lines, -0 lines 0 comments
D LayoutTests/mhtml/content_transfer_encoding_none-expected.txt View 1 chunk +0 lines, -3 lines 0 comments
M LayoutTests/mhtml/frame_4.html_original View 1 chunk +2 lines, -3 lines 0 comments
M LayoutTests/mhtml/invalid-bad-boundary.mht View 1 chunk +0 lines, -1 line 0 comments
A + LayoutTests/mhtml/invalid-bad-boundary-expected.html View 0 chunks +-1 lines, --1 lines 0 comments
D LayoutTests/mhtml/invalid-bad-boundary-expected.txt View 1 chunk +0 lines, -5 lines 0 comments
A + LayoutTests/mhtml/invalid-bad-boundary2-expected.html View 0 chunks +-1 lines, --1 lines 0 comments
D LayoutTests/mhtml/invalid-bad-boundary2-expected.txt View 1 chunk +0 lines, -5 lines 0 comments
A LayoutTests/mhtml/mhtml_in_iframe.html View 1 chunk +18 lines, -0 lines 0 comments
A LayoutTests/mhtml/mhtml_in_iframe-expected.txt View 1 chunk +8 lines, -0 lines 0 comments
M LayoutTests/mhtml/multi_frames.html_original View 1 chunk +2 lines, -9 lines 0 comments
M LayoutTests/mhtml/multi_frames_binary.mht View Binary file 0 comments
A LayoutTests/mhtml/multi_frames_binary-expected.html View 1 chunk +13 lines, -0 lines 0 comments
D LayoutTests/mhtml/multi_frames_binary-expected.txt View 1 chunk +0 lines, -31 lines 0 comments
M LayoutTests/mhtml/multi_frames_ie.mht View 3 chunks +3 lines, -13 lines 0 comments
A LayoutTests/mhtml/multi_frames_ie-expected.html View 1 chunk +13 lines, -0 lines 0 comments
D LayoutTests/mhtml/multi_frames_ie-expected.txt View 1 chunk +0 lines, -31 lines 0 comments
M LayoutTests/mhtml/multi_frames_unmht.mht View 2 chunks +2 lines, -12 lines 0 comments
A LayoutTests/mhtml/multi_frames_unmht-expected.html View 1 chunk +13 lines, -0 lines 0 comments
D LayoutTests/mhtml/multi_frames_unmht-expected.txt View 1 chunk +0 lines, -31 lines 0 comments
D LayoutTests/mhtml/new-image-not-in-archive.mht View 1 chunk +0 lines, -19 lines 0 comments
D LayoutTests/mhtml/new-image-not-in-archive-expected.txt View 1 chunk +0 lines, -1 line 0 comments
M LayoutTests/mhtml/page_with_css_and_js.html_original View 2 chunks +4 lines, -4 lines 0 comments
M LayoutTests/mhtml/page_with_css_and_js_ie.mht View 3 chunks +4 lines, -11 lines 0 comments
A LayoutTests/mhtml/page_with_css_and_js_ie-expected.html View 1 chunk +21 lines, -0 lines 0 comments
D LayoutTests/mhtml/page_with_css_and_js_ie-expected.txt View 1 chunk +0 lines, -6 lines 0 comments
M LayoutTests/mhtml/page_with_css_and_js_unmht.mht View 2 chunks +3 lines, -8 lines 0 comments
A LayoutTests/mhtml/page_with_css_and_js_unmht-expected.html View 1 chunk +21 lines, -0 lines 0 comments
D LayoutTests/mhtml/page_with_css_and_js_unmht-expected.txt View 1 chunk +0 lines, -6 lines 0 comments
M LayoutTests/mhtml/page_with_image.html_original View 1 chunk +2 lines, -10 lines 0 comments
M LayoutTests/mhtml/page_with_image_ie.mht View 1 chunk +1 line, -9 lines 0 comments
A LayoutTests/mhtml/page_with_image_ie-expected.html View 1 chunk +7 lines, -0 lines 0 comments
D LayoutTests/mhtml/page_with_image_ie-expected.txt View 1 chunk +0 lines, -3 lines 0 comments
M LayoutTests/mhtml/page_with_image_unmht.mht View 1 chunk +1 line, -9 lines 0 comments
A LayoutTests/mhtml/page_with_image_unmht-expected.html View 1 chunk +8 lines, -0 lines 0 comments
D LayoutTests/mhtml/page_with_image_unmht-expected.txt View 1 chunk +0 lines, -3 lines 0 comments
A + LayoutTests/mhtml/page_with_javascript.mht View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -11 lines 0 comments
A LayoutTests/mhtml/page_with_javascript-expected.html View 1 chunk +9 lines, -0 lines 0 comments
A + LayoutTests/mhtml/relative_url.mht View 1 chunk +6 lines, -11 lines 0 comments
A LayoutTests/mhtml/relative_url-expected.html View 1 chunk +10 lines, -0 lines 0 comments
M LayoutTests/mhtml/relaxed-content-type-parameters.mht View 1 chunk +0 lines, -4 lines 0 comments
M LayoutTests/mhtml/relaxed-content-type-parameters.mhtml_original View 1 chunk +0 lines, -4 lines 0 comments
A + LayoutTests/mhtml/relaxed-content-type-parameters-expected.html View 1 chunk +0 lines, -4 lines 0 comments
D LayoutTests/mhtml/relaxed-content-type-parameters-expected.txt View 1 chunk +0 lines, -1 line 0 comments
A + LayoutTests/mhtml/resources/frame_0.html View 0 chunks +-1 lines, --1 lines 0 comments
A + LayoutTests/mhtml/resources/frame_1.html View 0 chunks +-1 lines, --1 lines 0 comments
A + LayoutTests/mhtml/resources/frame_2.html View 0 chunks +-1 lines, --1 lines 0 comments
A LayoutTests/mhtml/resources/frame_4.html View 1 chunk +7 lines, -0 lines 0 comments
A + LayoutTests/mhtml/resources/style.css View 1 chunk +138 lines, -176 lines 0 comments
M LayoutTests/mhtml/shared_buffer_bug.mht View 1 chunk +0 lines, -5 lines 0 comments
A LayoutTests/mhtml/shared_buffer_bug-expected.html View 1 chunk +9 lines, -0 lines 0 comments
D LayoutTests/mhtml/shared_buffer_bug-expected.txt View 1 chunk +0 lines, -2 lines 0 comments
M LayoutTests/mhtml/simple_page_ie.mht View 1 chunk +0 lines, -4 lines 0 comments
A + LayoutTests/mhtml/simple_page_ie-expected.html View 1 chunk +1 line, -5 lines 0 comments
D LayoutTests/mhtml/simple_page_ie-expected.txt View 1 chunk +0 lines, -3 lines 0 comments
M LayoutTests/mhtml/simple_page_unmht.mht View 1 chunk +0 lines, -4 lines 0 comments
A + LayoutTests/mhtml/simple_page_unmht-expected.html View 1 chunk +1 line, -5 lines 0 comments
D LayoutTests/mhtml/simple_page_unmht-expected.txt View 1 chunk +0 lines, -3 lines 0 comments
M LayoutTests/mhtml/transfer_encoding_7bit.mht View 1 chunk +0 lines, -4 lines 0 comments
A + LayoutTests/mhtml/transfer_encoding_7bit-expected.html View 1 chunk +0 lines, -4 lines 0 comments
D LayoutTests/mhtml/transfer_encoding_7bit-expected.txt View 1 chunk +0 lines, -1 line 0 comments
A + LayoutTests/mhtml/transfer_encoding_8bit-expected.html View 1 chunk +0 lines, -4 lines 0 comments
D LayoutTests/mhtml/transfer_encoding_8bit-expected.txt View 1 chunk +0 lines, -1 line 0 comments
D LayoutTests/platform/win/mhtml/invalid-bad-boundary-expected.png View Binary file 0 comments
D LayoutTests/platform/win/mhtml/invalid-bad-boundary2-expected.png View Binary file 0 comments
M Source/core/loader/DocumentLoader.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -0 lines 0 comments
A Source/web/tests/MHTMLTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +121 lines, -0 lines 0 comments
A + Source/web/tests/data/mhtml/simple_test.mht View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -4 lines 0 comments
M Source/web/web.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments

Messages

Total messages: 14 (0 generated)
Jay Civelli
6 years, 10 months ago (2014-02-12 21:55:26 UTC) #1
abarth-chromium
https://codereview.chromium.org/161383002/diff/40001/Source/core/loader/DocumentLoader.cpp File Source/core/loader/DocumentLoader.cpp (right): https://codereview.chromium.org/161383002/diff/40001/Source/core/loader/DocumentLoader.cpp#newcode629 Source/core/loader/DocumentLoader.cpp:629: m_frame->settings()->setScriptEnabled(false); Won't this setting persist until after the MHTML ...
6 years, 10 months ago (2014-02-12 22:09:15 UTC) #2
Jay Civelli
Now using the sandbox flags. (It seems my patch is in a weird state on ...
6 years, 10 months ago (2014-02-12 23:26:35 UTC) #3
abarth-chromium
https://codereview.chromium.org/161383002/diff/180001/Source/core/loader/DocumentLoader.cpp File Source/core/loader/DocumentLoader.cpp (right): https://codereview.chromium.org/161383002/diff/180001/Source/core/loader/DocumentLoader.cpp#newcode284 Source/core/loader/DocumentLoader.cpp:284: document()->enforceSandboxFlags(SandboxAll); This is probably too late. You want to ...
6 years, 10 months ago (2014-02-12 23:35:38 UTC) #4
Jay Civelli
On 2014/02/12 23:35:38, abarth wrote: > https://codereview.chromium.org/161383002/diff/180001/Source/core/loader/DocumentLoader.cpp > File Source/core/loader/DocumentLoader.cpp (right): > > https://codereview.chromium.org/161383002/diff/180001/Source/core/loader/DocumentLoader.cpp#newcode284 > ...
6 years, 10 months ago (2014-02-13 00:37:58 UTC) #5
abarth-chromium
On 2014/02/13 00:37:58, Jay Civelli wrote: > I could move that code do maybeCreateArchive() if ...
6 years, 10 months ago (2014-02-13 01:22:37 UTC) #6
Jay Civelli
On 2014/02/13 01:22:37, abarth wrote: > On 2014/02/13 00:37:58, Jay Civelli wrote: > > I ...
6 years, 10 months ago (2014-02-13 01:51:39 UTC) #7
abarth-chromium
On 2014/02/13 01:51:39, Jay Civelli wrote: > It does not work because we don't have ...
6 years, 10 months ago (2014-02-13 02:03:05 UTC) #8
Jay Civelli
On 2014/02/13 02:03:05, abarth wrote: > On 2014/02/13 01:51:39, Jay Civelli wrote: > > It ...
6 years, 10 months ago (2014-02-13 02:12:22 UTC) #9
abarth-chromium
LGTM Thanks for iterating on this CL.
6 years, 10 months ago (2014-02-13 02:14:16 UTC) #10
jschuh
I don't know the code, but lgtm to whatever @abarth agreed to. And thanks for ...
6 years, 10 months ago (2014-02-13 04:01:10 UTC) #11
jschuh
Was there any particular hold-up on getting this landed?
6 years, 9 months ago (2014-03-14 13:59:45 UTC) #12
Jay Civelli
I kept running into problems trying to land this. Trybots would fail because the EOL ...
6 years, 9 months ago (2014-03-14 17:07:11 UTC) #13
Jay Civelli
6 years, 9 months ago (2014-03-18 23:26:31 UTC) #14
Message was sent while issue was closed.
Committed patchset #12 manually as r169499 (presubmit successful).

Powered by Google App Engine