|
|
|
|
| 4 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 |
|
5 |
|
| 6 |
#ifndef mozilla_StyleStructContext_h |
6 |
#ifndef mozilla_StyleStructContext_h |
| 7 |
#define mozilla_StyleStructContext_h |
7 |
#define mozilla_StyleStructContext_h |
| 8 |
|
8 |
|
| 9 |
#include "CounterStyleManager.h" |
9 |
#include "CounterStyleManager.h" |
| 10 |
#include "mozilla/LookAndFeel.h" |
10 |
#include "mozilla/LookAndFeel.h" |
| 11 |
#include "nsPresContext.h" |
11 |
#include "nsPresContext.h" |
|
|
12 |
#include "mozilla/StyleSetHandle.h" |
| 12 |
|
13 |
|
| 13 |
class nsDeviceContext; |
14 |
class nsDeviceContext; |
| 14 |
|
15 |
|
| 15 |
/** |
16 |
/** |
| 16 |
* Construction context for style structs. |
17 |
* Construction context for style structs. |
| 17 |
* |
18 |
* |
| 18 |
* Certain Gecko style structs have historically taken an nsPresContext |
19 |
* Certain Gecko style structs have historically taken an nsPresContext |
| 19 |
* argument in their constructor, which is used to compute various things. This |
20 |
* argument in their constructor, which is used to compute various things. This |
|
Lines 83-98
public:
|
Link Here
|
|---|
|
| 83 |
// Workaround Bug 1323404 |
84 |
// Workaround Bug 1323404 |
| 84 |
SERVO_DEFAULT(NS_RGB(0x00, 0x00, 0x00)); |
85 |
SERVO_DEFAULT(NS_RGB(0x00, 0x00, 0x00)); |
| 85 |
return mPresContext->DefaultColor(); |
86 |
return mPresContext->DefaultColor(); |
| 86 |
} |
87 |
} |
| 87 |
|
88 |
|
| 88 |
mozilla::CounterStyle* BuildCounterStyle(const nsSubstring& aName) |
89 |
mozilla::CounterStyle* BuildCounterStyle(const nsSubstring& aName) |
| 89 |
{ |
90 |
{ |
| 90 |
SERVO_DEFAULT(mozilla::CounterStyleManager::GetBuiltinStyle(NS_STYLE_LIST_STYLE_DISC)); |
91 |
SERVO_DEFAULT(mozilla::CounterStyleManager::GetBuiltinStyle(NS_STYLE_LIST_STYLE_DISC)); |
|
|
92 |
// For the servo case we want to keep not calling into the counter style |
| 93 |
// manager even if we have a prescontext, because we haven't made that work |
| 94 |
// with servo yet. |
| 95 |
if (mPresContext->StyleSet()->IsServo()) { |
| 96 |
return mozilla::CounterStyleManager::GetBuiltinStyle(NS_STYLE_LIST_STYLE_DISC); |
| 97 |
} |
| 91 |
return mPresContext->CounterStyleManager()->BuildCounterStyle(aName); |
98 |
return mPresContext->CounterStyleManager()->BuildCounterStyle(aName); |
| 92 |
} |
99 |
} |
| 93 |
|
100 |
|
| 94 |
nsIAtom* GetLanguageFromCharset() const |
101 |
nsIAtom* GetLanguageFromCharset() const |
| 95 |
{ |
102 |
{ |
| 96 |
SERVO_DEFAULT(nsGkAtoms::x_western); |
103 |
SERVO_DEFAULT(nsGkAtoms::x_western); |
| 97 |
return mPresContext->GetLanguageFromCharset(); |
104 |
return mPresContext->GetLanguageFromCharset(); |
| 98 |
} |
105 |
} |