Commit aa366648 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Insert element into document before calling StyleForElement().

Disconnected elements do not have style and ancestor computed styles
need to be construced in order to do inheritance. Attempt at adding
sanity DCHECKs in StyleResolver failed because of these tests.

Change-Id: Ic61abc2dc84ccf0d303fde41900e819b6b0723ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789528
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694245}
parent 484cc551
......@@ -44,6 +44,7 @@
#include "third_party/blink/renderer/core/css/property_registry.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
......@@ -56,7 +57,9 @@ class AnimationKeyframeEffectModel : public PageTestBase {
protected:
void SetUp() override {
PageTestBase::SetUp(IntSize());
GetDocument().UpdateStyleAndLayoutTree();
element = GetDocument().CreateElementForBinding("foo");
GetDocument().body()->appendChild(element);
}
void ExpectLengthValue(double expected_value,
......
......@@ -89,7 +89,8 @@ class WorkletAnimationTest : public RenderingTest {
void SetUp() override {
RenderingTest::SetUp();
element_ = GetDocument().CreateElementForBinding("test");
// Animator has to be registored before constructing WorkletAnimation. For
GetDocument().body()->appendChild(element_);
// Animator has to be registered before constructing WorkletAnimation. For
// unit test this is faked by adding the animator name to
// WorkletAnimationController.
animator_name_ = "WorkletAnimationTest";
......
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