Skip to content

Commit

Permalink
more 1436 Asserts (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
Domiii committed Jun 27, 2023
1 parent 8827629 commit 9d6f915
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions third_party/blink/renderer/core/css/resolver/font_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ void FontBuilder::CreateFont(ComputedStyle& style,
const ComputedStyle* parent_style) {
DCHECK(document_);

recordreplay::Assert("[RUN-1436-2237] FontBuilder::CreateFont A %u", flags_);
if (!flags_)
return;

Expand All @@ -495,6 +496,8 @@ void FontBuilder::CreateFont(ComputedStyle& style,
FontSelector* font_selector = ComputeFontSelector(style);
UpdateAdjustedSize(description, style, font_selector);

recordreplay::Assert("[RUN-1436-2237] FontBuilder::CreateFont B %d",
!!font_selector);
style.SetFontInternal(Font(description, font_selector));
flags_ = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,10 @@ StyleResolver::CacheSuccess StyleResolver::ApplyMatchedCache(
const CachedMatchedProperties* cached_matched_properties =
key.IsValid() ? matched_properties_cache_.Find(key, state) : nullptr;

recordreplay::Assert("[RUN-1436-2237] StyleResolver::ApplyMatchedCache %d %d",
!!cached_matched_properties,
MatchedPropertiesCache::IsCacheable(state));

AtomicString pseudo_argument = state.Style()->PseudoArgument();
if (cached_matched_properties && MatchedPropertiesCache::IsCacheable(state)) {
INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(),
Expand Down
8 changes: 8 additions & 0 deletions third_party/blink/renderer/core/dom/container_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -936,17 +936,25 @@ Node* ContainerNode::AppendChild(Node* new_child,
exception_state))
return new_child;

recordreplay::Assert("[RUN-1436-2237] ContainerNode::AppendChild A %d",
new_child->RecordReplayId());

NodeVector targets;
DOMTreeMutationDetector detector(*new_child, *this);
if (!CollectChildrenAndRemoveFromOldParent(*new_child, targets,
exception_state))
return new_child;

recordreplay::Assert("[RUN-1436-2237] ContainerNode::AppendChild B");

if (!detector.NeedsRecheck()) {
if (!RecheckNodeInsertionStructuralPrereq(targets, nullptr,
exception_state))
return new_child;
}

recordreplay::Assert("[RUN-1436-2237] ContainerNode::AppendChild C");

NodeVector post_insertion_notification_targets;
{
SlotAssignmentRecalcForbiddenScope forbid_slot_recalc(GetDocument());
Expand Down
16 changes: 16 additions & 0 deletions third_party/blink/renderer/core/svg/svg_use_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,18 @@ SVGElement* SVGUseElement::InstanceRoot() const {
}

void SVGUseElement::BuildPendingResource() {
recordreplay::Assert(
"[RUN-1436-2237] SVGUseElement::BuildPendingResource A %d",
RecordReplayId());
if (!isConnected()) {
DCHECK(!needs_shadow_tree_recreation_);
return; // Already replaced by rebuilding ancestor.
}
CancelShadowTreeRecreation();

recordreplay::Assert(
"[RUN-1436-2237] SVGUseElement::BuildPendingResource B");

// Check if this element is scheduled (by an ancestor) to be replaced.
SVGUseElement* ancestor = GeneratingUseElement();
while (ancestor) {
Expand All @@ -342,6 +348,8 @@ void SVGUseElement::BuildPendingResource() {
ancestor = ancestor->GeneratingUseElement();
}

recordreplay::Assert("[RUN-1436-2237] SVGUseElement::BuildPendingResource C");

DetachShadowTree();
ClearResourceReference();

Expand Down Expand Up @@ -472,6 +480,12 @@ void SVGUseElement::AttachShadowTree(SVGElement& target) {
DCHECK(!InstanceRoot());
DCHECK(!needs_shadow_tree_recreation_);

recordreplay::Assert(
"[RUN-1436-2237] SVGUseElement::AttachShadowTree A %d %d %d %d",
RecordReplayId(),
target.RecordReplayId(), IsDisallowedElement(target),
HasCycleUseReferencing(*this, target));

// Do not allow self-referencing.
if (IsDisallowedElement(target) || HasCycleUseReferencing(*this, target))
return;
Expand All @@ -485,6 +499,8 @@ void SVGUseElement::AttachShadowTree(SVGElement& target) {
PostProcessInstanceTree(target, *instance_root);

// Finally attach to the tree.
recordreplay::Assert("[RUN-1436-2237] SVGUseElement::AttachShadowTree B %d",
UseShadowRoot().RecordReplayId());
UseShadowRoot().AppendChild(instance_root);

// Assure shadow tree building was successful.
Expand Down

0 comments on commit 9d6f915

Please sign in to comment.