Commit 174e7623 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

Fix SetAhemBody to set proper font size

LayoutTextTest and LayoutTextFragmentTest do not set font-size
when SetAhemBody is used. This caused DCHECK failures added in
CL:1111895 due to too much rounding errors.

This patch fixes that by setting the font-size to 10px.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I6e945a6f07902c50bbfcbca4014d324ba1ae1d0a
Reviewed-on: https://chromium-review.googlesource.com/1113697Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570289}
parent eec9ed5e
......@@ -26,7 +26,7 @@ class LayoutTextFragmentTest : public RenderingTest {
void SetAhemBody(const char* message, const unsigned width) {
SetBodyInnerHTML(String::Format(
"<div id='target' style='font: Ahem; width: %uem'>%s</div>", width,
"<div id='target' style='font: 10px Ahem; width: %uem'>%s</div>", width,
message));
}
......
......@@ -27,7 +27,7 @@ class LayoutTextTest : public RenderingTest {
void SetAhemBody(const char* message, const unsigned width) {
SetBodyInnerHTML(String::Format(
"<div id='target' style='font: Ahem; width: %uem'>%s</div>", width,
"<div id='target' style='font: 10px Ahem; width: %uem'>%s</div>", width,
message));
}
......
......@@ -4,7 +4,6 @@
#include "third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.h"
#include "build/build_config.h"
#include "third_party/blink/renderer/core/layout/layout_list_marker.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_bidi_paragraph.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_break_token.h"
......@@ -304,10 +303,7 @@ void NGLineBreaker::UpdatePosition(const NGLineInfo& line_info) {
void NGLineBreaker::ComputeLineLocation(NGLineInfo* line_info) const {
LayoutUnit bfc_line_offset = line_.line_opportunity.line_left_offset;
LayoutUnit available_width = line_.AvailableWidth();
// TODO(kojii): IsBeforeAfterNonCollapsedLineWrapSpace fails only on Mac
#if !defined(OS_MACOSX)
DCHECK_EQ(line_.position, line_info->ComputeWidth());
#endif
// Negative margins can make the position negative, but the inline size is
// always positive or 0.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment