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

Issue 1558503003: 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

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -6 lines) Patch
A third_party/WebKit/LayoutTests/printing/page-height-zero.html View 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/printing/page-height-zero-expected.txt View 1 chunk +4 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:

Powered by Google App Engine
This is Rietveld 408576698