0
Files
src/content/web_test/renderer/pixel_dump.h
Morten Stenshorne ecd033fe40 Default page margin of 0.5in for WPT print reftests.
https://web-platform-tests.org/writing-tests/print-reftests.html still
doesn't mention any margins (just says to use a page size of 5 by 3
inches), but Firefox also uses 0.5 inch margins, and some tests expect
this too. Furthermore,
https://github.com/web-platform-tests/rfcs/blob/master/rfcs/print_test.md
wants us to use 0.5 inch margins as well.

Update some documentation pertaining to page size, to clarify that this
is just the *default* page size, which may be overridden using @page CSS
rules.

This fixed two tests that were assumed to fail because of subpixel
rounding issues, but this was apparently wrong.

A couple of tests (written by me) had to be updated because of this
change (because they assumed 0 margins).

Bug: 1090628
Change-Id: Ib12af644e544ad51be5750dba98f97bfddf38bdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5067421
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1231300}
2023-11-30 14:31:33 +00:00

29 lines
848 B
C++

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_WEB_TEST_RENDERER_PIXEL_DUMP_H_
#define CONTENT_WEB_TEST_RENDERER_PIXEL_DUMP_H_
#include "printing/page_range.h"
#include "ui/gfx/geometry/size.h"
class SkBitmap;
namespace blink {
class WebLocalFrame;
} // namespace blink
namespace content {
// Goes through a test-only path to dump the frame's pixel output as if it was
// printed. Page size and margins are in CSS pixels.
SkBitmap PrintFrameToBitmap(blink::WebLocalFrame* web_frame,
const gfx::Size& page_size,
int default_margins,
const printing::PageRanges& pages);
} // namespace content
#endif // CONTENT_WEB_TEST_RENDERER_PIXEL_DUMP_H_