Skip to content

Commit

Permalink
RUN-2230: Assert LayoutNGSVGText::UpdateBlockLayout (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
Domiii committed Jun 22, 2023
1 parent a563124 commit de41f1c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
18 changes: 2 additions & 16 deletions third_party/blink/renderer/core/dom/attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
#include "third_party/blink/renderer/core/dom/qualified_name.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"

#include "base/record_replay.h"
#include "third_party/blink/renderer/core/html_names.h"

namespace blink {

// This value is set fairly arbitrarily, to get above what we expect to be
Expand All @@ -53,12 +50,7 @@ class Attribute {

public:
Attribute(const QualifiedName& name, const AtomicString& value)
: name_(name), value_(value) {
if (name == html_names::kSrcAttr) {
recordreplay::Assert("[RUN-658-1438] Attribute::Attribute %s",
value.IsNull() ? "(null)" : value.Utf8().c_str());
}
}
: name_(name), value_(value) {}
Attribute(QualifiedName&& name, AtomicString&& value)
: name_(std::move(name)), value_(std::move(value)) {}

Expand All @@ -76,13 +68,7 @@ class Attribute {
bool Matches(const QualifiedName&) const;
bool MatchesCaseInsensitive(const QualifiedName&) const;

void SetValue(const AtomicString& value) {
if (name_ == html_names::kSrcAttr) {
recordreplay::Assert("[RUN-658-1438] Attribute::SetValue %s",
value.IsNull() ? "(null)" : value.Utf8().c_str());
}
value_ = value;
}
void SetValue(const AtomicString& value) { value_ = value; }

// Note: This API is only for HTMLTreeBuilder. It is not safe to change the
// name of an attribute once parseAttribute has been called as DOM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ template <typename Base>
void LayoutNGBlockFlowMixin<Base>::UpdateNGBlockLayout() {
Base::CheckIsNotDestroyed();

recordreplay::Assert(
"[RUN-1239-2230] LayoutNGBlockFlowMixin::UpdateNGBlockLayout %d",
Base::IsOutOfFlowPositioned());
if (Base::IsOutOfFlowPositioned()) {
LayoutNGMixin<Base>::UpdateOutOfFlowBlockLayout();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ void LayoutNGSVGText::UpdateBlockLayout(bool relayout_children) {

gfx::RectF old_boundaries = ObjectBoundingBox();

recordreplay::Assert("[RUN-1239-2230] LayoutNGSVGText::UpdateBlockLayout A %d",
GetElement()->RecordReplayId());
UpdateNGBlockLayout();
recordreplay::Assert("[RUN-1239-2230] LayoutNGSVGText::UpdateBlockLayout B %d",
GetElement()->RecordReplayId());

needs_update_bounding_box_ = true;

gfx::RectF boundaries = ObjectBoundingBox();
Expand Down
4 changes: 0 additions & 4 deletions third_party/blink/renderer/platform/geometry/layout_unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ class LayoutUnit {

LayoutUnit AddEpsilon() const {
LayoutUnit return_value;

// https://linear.app/replay/issue/RUN-1239#comment-df307091
recordreplay::Assert("[RUN-1239-1435] LayoutUnit::AddEpsilon %d", value_);

return_value.SetRawValue(
value_ < std::numeric_limits<int>::max() ? value_ + 1 : value_);
return return_value;
Expand Down

0 comments on commit de41f1c

Please sign in to comment.