Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Side by Side Diff: third_party/WebKit/Source/core/dom/ElementRareDataTest.cpp

Issue 2293713002: Made ElementRareData store ComputedStyle on LayoutObject if possible. (Closed)
Patch Set: Added CORE_EXPORT to NodeRareDataBase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/dom/ElementRareData.h"
6
7 #include "core/layout/LayoutInline.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace blink {
11
12 TEST(ElementRareDataTest, ComputedStyleStorage)
13 {
14 // Without LayoutObject
15 ElementRareData* rareData = ElementRareData::create(nullptr);
16 RefPtr<ComputedStyle> style = ComputedStyle::create();
17 rareData->setComputedStyle(style);
18 EXPECT_EQ(style.get(), rareData->computedStyle());
19
20 // With LayoutObject
21 LayoutObject* layoutObject = new LayoutInline(nullptr);
22 rareData = ElementRareData::create(layoutObject);
23 rareData->setComputedStyle(style);
24 EXPECT_EQ(style.get(), rareData->computedStyle());
25
26 rareData->setLayoutObject(nullptr);
27 delete layoutObject;
28 }
29
30 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698