/src/mozilla-central/layout/style/ServoElementSnapshot.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "mozilla/ServoElementSnapshot.h" |
8 | | #include "mozilla/ServoBindings.h" |
9 | | #include "mozilla/dom/Element.h" |
10 | | #include "nsIContentInlines.h" |
11 | | #include "nsContentUtils.h" |
12 | | |
13 | | namespace mozilla { |
14 | | |
15 | | ServoElementSnapshot::ServoElementSnapshot(const Element& aElement) |
16 | | : mState(0) |
17 | | , mContains(Flags(0)) |
18 | | , mIsTableBorderNonzero(false) |
19 | | , mIsMozBrowserFrame(false) |
20 | | , mClassAttributeChanged(false) |
21 | | , mIdAttributeChanged(false) |
22 | | , mOtherAttributeChanged(false) |
23 | 0 | { |
24 | 0 | MOZ_COUNT_CTOR(ServoElementSnapshot); |
25 | 0 | MOZ_ASSERT(NS_IsMainThread()); |
26 | 0 | mIsHTMLElementInHTMLDocument = |
27 | 0 | aElement.IsHTMLElement() && aElement.IsInHTMLDocument(); |
28 | 0 | mIsInChromeDocument = nsContentUtils::IsChromeDoc(aElement.OwnerDoc()); |
29 | 0 | mSupportsLangAttr = aElement.SupportsLangAttr(); |
30 | 0 | } |
31 | | |
32 | | void |
33 | | ServoElementSnapshot::AddOtherPseudoClassState(const Element& aElement) |
34 | 0 | { |
35 | 0 | if (HasOtherPseudoClassState()) { |
36 | 0 | return; |
37 | 0 | } |
38 | 0 | |
39 | 0 | mIsTableBorderNonzero = Gecko_IsTableBorderNonzero(&aElement); |
40 | 0 | mIsMozBrowserFrame = Gecko_IsBrowserFrame(&aElement); |
41 | 0 |
|
42 | 0 | mContains |= Flags::OtherPseudoClassState; |
43 | 0 | } |
44 | | |
45 | | } // namespace mozilla |