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

Issue 1552703003: Internals: throw an exception when page height or width is 0. (Closed)

Created:
4 years, 11 months ago by mstensho (USE GERRIT)
Modified:
4 years, 11 months ago
Reviewers:
rune
CC:
chromium-reviews, blink-reviews, mstensho (USE GERRIT)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Internals: throw an exception when page height or width is 0. The two methods pageNumber() and numberOfPages() on the window.internals object allowed 0 as page height, which results in a division by zero in multicol (and general failure to paginate in other parts of the code). Have the methods raise an exception when such values are provided. Also specify the default width and height values in Internals.idl rather than in Internals.h, so that they actually do something. Our default page width and height were effectively 0 for these methods. Assert that width and height have valid values (i.e. greater than 0) in PrintContext::begin(). BUG=571348 R=rune@opera.com Committed: https://crrev.com/d4e093476e0c2843c11494e87dda1da9b77f03ca Cr-Commit-Position: refs/heads/master@{#367304}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use js-test.js , which provides shouldThrow() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -6 lines) Patch
A third_party/WebKit/LayoutTests/printing/page-height-zero.html View 1 1 chunk +19 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/printing/page-height-zero-expected.txt View 1 1 chunk +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/PrintContext.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 2 chunks +12 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.idl View 1 chunk +2 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 9 (2 generated)
mstensho (USE GERRIT)
4 years, 11 months ago (2015-12-30 14:12:15 UTC) #1
rune
https://codereview.chromium.org/1552703003/diff/1/third_party/WebKit/LayoutTests/printing/page-height-zero.html File third_party/WebKit/LayoutTests/printing/page-height-zero.html (right): https://codereview.chromium.org/1552703003/diff/1/third_party/WebKit/LayoutTests/printing/page-height-zero.html#newcode18 third_party/WebKit/LayoutTests/printing/page-height-zero.html:18: internals.numberOfPages(100, 0); Why not use js-test.js which does dumpAsText(), ...
4 years, 11 months ago (2016-01-04 09:09:54 UTC) #2
mstensho (USE GERRIT)
https://codereview.chromium.org/1552703003/diff/1/third_party/WebKit/LayoutTests/printing/page-height-zero.html File third_party/WebKit/LayoutTests/printing/page-height-zero.html (right): https://codereview.chromium.org/1552703003/diff/1/third_party/WebKit/LayoutTests/printing/page-height-zero.html#newcode18 third_party/WebKit/LayoutTests/printing/page-height-zero.html:18: internals.numberOfPages(100, 0); On 2016/01/04 09:09:54, rune wrote: > Why ...
4 years, 11 months ago (2016-01-04 09:36:08 UTC) #3
rune
lgtm
4 years, 11 months ago (2016-01-04 10:25:07 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1552703003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1552703003/20001
4 years, 11 months ago (2016-01-04 10:38:22 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 11 months ago (2016-01-04 13:44:26 UTC) #7
commit-bot: I haz the power
4 years, 11 months ago (2016-01-04 13:45:25 UTC) #9
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/d4e093476e0c2843c11494e87dda1da9b77f03ca
Cr-Commit-Position: refs/heads/master@{#367304}

Powered by Google App Engine
This is Rietveld 408576698