Compare commits
412
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e71937e76a | ||
|
|
4a44bfe8fa | ||
|
|
adb58c5761 | ||
|
|
8f7e7bfbdc | ||
|
|
96ad821193 | ||
|
|
0742779ec4 | ||
|
|
e6199f8a32 | ||
|
|
ae87e5c8ca | ||
|
|
130720d927 | ||
|
|
0f0d36de2d | ||
|
|
2879b5abf6 | ||
|
|
84a29728aa | ||
|
|
38e63a2457 | ||
|
|
809bb089c1 | ||
|
|
7cc6e4f072 | ||
|
|
9605315718 | ||
|
|
c2362f7f61 | ||
|
|
6e2a713c37 | ||
|
|
c617548958 | ||
|
|
d8acf27de1 | ||
|
|
de2bd6aa57 | ||
|
|
666b1f2db8 | ||
|
|
17e3f40c2e | ||
|
|
be0dc5dd26 | ||
|
|
43862ee764 | ||
|
|
fe6af19126 | ||
|
|
f982245af3 | ||
|
|
1fe46b057e | ||
|
|
197e21f6de | ||
|
|
58a3105a0e | ||
|
|
c1703a6928 | ||
|
|
786c16fd45 | ||
|
|
49b7816286 | ||
|
|
3aec8d2838 | ||
|
|
e4829019cd | ||
|
|
acb34c35db | ||
|
|
e484c9d311 | ||
|
|
6cbb2c372b | ||
|
|
5470407781 | ||
|
|
f9eaedbe2d | ||
|
|
5152b9b64a | ||
|
|
46feb81dd3 | ||
|
|
59796f3e9d | ||
|
|
83b16ecc7f | ||
|
|
2baeb2083b | ||
|
|
3ac7635150 | ||
|
|
a7e19fc7ae | ||
|
|
229517f9cd | ||
|
|
d90a4ea28c | ||
|
|
70b1711085 | ||
|
|
49aa1346da | ||
|
|
aba23a13a3 | ||
|
|
e4254a9555 | ||
|
|
cafaac1939 | ||
|
|
803f821d5b | ||
|
|
f3fb26a44f | ||
|
|
27f64dc348 | ||
|
|
ac36221d70 | ||
|
|
0f8e267fd1 | ||
|
|
c4665f5f6c | ||
|
|
983be16f8a | ||
|
|
6ebd47222a | ||
|
|
68a4b8e3d4 | ||
|
|
3d76969fa8 | ||
|
|
791fd0300e | ||
|
|
0635ffcca3 | ||
|
|
b96a2237e0 | ||
|
|
59c863a900 | ||
|
|
8bfe1f3a7d | ||
|
|
878709cd23 | ||
|
|
ea87895dd9 | ||
|
|
6b25fb2b3a | ||
|
|
02a1efa9fa | ||
|
|
d65a4c0628 | ||
|
|
c991295c93 | ||
|
|
763bcea405 | ||
|
|
c87d9f3cff | ||
|
|
8bc18ff5d4 | ||
|
|
f9508fa3cc | ||
|
|
28836a35ed | ||
|
|
a7d460c060 | ||
|
|
3434ea57c1 | ||
|
|
631e3a73e3 | ||
|
|
b4a3d59128 | ||
|
|
cd8b0b38e8 | ||
|
|
35311d664a | ||
|
|
9a5fe6f542 | ||
|
|
28ba2fb374 | ||
|
|
d423c54d9c | ||
|
|
b3a016ac20 | ||
|
|
536af00ab2 | ||
|
|
041f0bd4f4 | ||
|
|
dc6a8eea09 | ||
|
|
ea4c79e18d | ||
|
|
f8861235ed | ||
|
|
55bee27c30 | ||
|
|
d5add46c05 | ||
|
|
13cfa63316 | ||
|
|
bbb66a5500 | ||
|
|
90b015560d | ||
|
|
e38b57caa7 | ||
|
|
d003a2fba9 | ||
|
|
b22e7e4350 | ||
|
|
1c8d691c2a | ||
|
|
5f39ff87a0 | ||
|
|
3ec13cbb4e | ||
|
|
8dd55ce170 | ||
|
|
1ed0fa9f83 | ||
|
|
9eb661a899 | ||
|
|
b3bde74dce | ||
|
|
b4224e3aff | ||
|
|
dbeb9a8d4f | ||
|
|
0555400605 | ||
|
|
fb88b2cc90 | ||
|
|
7f48de6549 | ||
|
|
f16c8418aa | ||
|
|
4d90060dd8 | ||
|
|
c0c6b38c18 | ||
|
|
fb6a751759 | ||
|
|
e8e43b846c | ||
|
|
3e33eda290 | ||
|
|
2e8852cbf0 | ||
|
|
df9a143414 | ||
|
|
9dbaf7f6f8 | ||
|
|
c3fa38f0d7 | ||
|
|
da4399a912 | ||
|
|
425dc7f02b | ||
|
|
456e1a5860 | ||
|
|
f82f5aaf29 | ||
|
|
e18de3ac2b | ||
|
|
1ecde083b1 | ||
|
|
71101dc40c | ||
|
|
a00ca6d871 | ||
|
|
182b567fa8 | ||
|
|
7d330b89c8 | ||
|
|
21c13fc9cd | ||
|
|
889e3e3805 | ||
|
|
7ad5cc471d | ||
|
|
7ef3048c5e | ||
|
|
999640b68c | ||
|
|
1abfd0f004 | ||
|
|
37a033304d | ||
|
|
8df70dabe6 | ||
|
|
2c50617e64 | ||
|
|
87d7489bc3 | ||
|
|
a79400a939 | ||
|
|
4b51e3ecc9 | ||
|
|
9dbe31a41e | ||
|
|
a5366670aa | ||
|
|
abb1298631 | ||
|
|
56f255859c | ||
|
|
7a1e01c0f3 | ||
|
|
83857453b1 | ||
|
|
046c7e92a4 | ||
|
|
3e7fbd39df | ||
|
|
56d1a62f5d | ||
|
|
8e609c4594 | ||
|
|
238226ce46 | ||
|
|
0d2e285caa | ||
|
|
91309c6d9d | ||
|
|
268c95d95f | ||
|
|
f0cce53b37 | ||
|
|
8f11d64255 | ||
|
|
7c32e33769 | ||
|
|
99f208ad22 | ||
|
|
06eca091f7 | ||
|
|
8fc5e4bd24 | ||
|
|
110e4f1ca2 | ||
|
|
73e94dd628 | ||
|
|
783b48a083 | ||
|
|
9279b01433 | ||
|
|
afc9a8cafa | ||
|
|
476fc70de9 | ||
|
|
ea7435c05e | ||
|
|
01d0962f62 | ||
|
|
16aeb39791 | ||
|
|
ba97710cdf | ||
|
|
56157c149a | ||
|
|
02c4302711 | ||
|
|
0616807ac3 | ||
|
|
2d7a4f2655 | ||
|
|
7182490961 | ||
|
|
a054bcc23b | ||
|
|
2fdc4c71ce | ||
|
|
6689328efe | ||
|
|
c757d71379 | ||
|
|
690127c618 | ||
|
|
038774e52b | ||
|
|
c38a8256f3 | ||
|
|
c6a60994b7 | ||
|
|
38411ba78a | ||
|
|
c03d2c2cc5 | ||
|
|
3c46488a8c | ||
|
|
60f1eab6c2 | ||
|
|
9851eee94a | ||
|
|
09b3e1deeb | ||
|
|
993e1b50e2 | ||
|
|
cf06215a9d | ||
|
|
252c4bdc74 | ||
|
|
b2319aff7f | ||
|
|
a9f263c081 | ||
|
|
9db0c6779a | ||
|
|
16d0e3694c | ||
|
|
fc170a373c | ||
|
|
6cd9f36c28 | ||
|
|
d4070c7554 | ||
|
|
ac32a184f1 | ||
|
|
6bb1b66457 | ||
|
|
be728322e0 | ||
|
|
70f567950b | ||
|
|
cc697eb106 | ||
|
|
e2e50d065f | ||
|
|
133ec26f5e | ||
|
|
a66c8a088f | ||
|
|
2354011d48 | ||
|
|
722eaab39a | ||
|
|
05cebf17e0 | ||
|
|
9ea951fa6a | ||
|
|
174b2b76df | ||
|
|
9af4b97fbe | ||
|
|
bbf374ad17 | ||
|
|
ba58438b41 | ||
|
|
0bf5eaaa2b | ||
|
|
2f65157f25 | ||
|
|
ff713f133e | ||
|
|
b787af5702 | ||
|
|
82395acfa6 | ||
|
|
994792bdc8 | ||
|
|
d36fa8bfce | ||
|
|
9dac9de154 | ||
|
|
391e17626b | ||
|
|
2150fb7fa9 | ||
|
|
3dd8bc0ddb | ||
|
|
0fe8ac9349 | ||
|
|
a35ee1a6a5 | ||
|
|
d20b1f2fb6 | ||
|
|
a86b4c35f1 | ||
|
|
6b00d13010 | ||
|
|
830a634cec | ||
|
|
80207d6d3f | ||
|
|
f4a49d6063 | ||
|
|
86d22c2135 | ||
|
|
2b14856b57 | ||
|
|
dfbf2aef81 | ||
|
|
db049fa0cd | ||
|
|
27f416684f | ||
|
|
6ad6336fc9 | ||
|
|
0044a85a07 | ||
|
|
ec5d6d9b5d | ||
|
|
d9bd92c926 | ||
|
|
afeab7fe26 | ||
|
|
ba183ce002 | ||
|
|
e3520a9118 | ||
|
|
ae667c9a36 | ||
|
|
14826c037b | ||
|
|
6bc2cfe6c1 | ||
|
|
ca2f56cd5c | ||
|
|
0dde96ba82 | ||
|
|
980956063f | ||
|
|
babe1377c6 | ||
|
|
5e53809bb7 | ||
|
|
c92b079235 | ||
|
|
9e3d5c38e8 | ||
|
|
13476d771e | ||
|
|
1c298ec2a6 | ||
|
|
bf94026f51 | ||
|
|
06714827ac | ||
|
|
be7d317f21 | ||
|
|
bfe71e3271 | ||
|
|
c4354d3775 | ||
|
|
22def28c94 | ||
|
|
d79038b500 | ||
|
|
9a3ac861de | ||
|
|
6929ce1f87 | ||
|
|
eaaa7ec3ab | ||
|
|
66b07ce699 | ||
|
|
dda1cf6f26 | ||
|
|
779fc8abf3 | ||
|
|
87b346631f | ||
|
|
b6121d3525 | ||
|
|
49a6a85969 | ||
|
|
ce717e2633 | ||
|
|
b2399c9b76 | ||
|
|
dd2f013047 | ||
|
|
bc6de3eb9d | ||
|
|
27c8f022f1 | ||
|
|
7ee0259133 | ||
|
|
c84c6189cf | ||
|
|
1f7023294a | ||
|
|
041e7e7e47 | ||
|
|
4b1b9cac33 | ||
|
|
f9898e24e9 | ||
|
|
b6bb2995b1 | ||
|
|
37e49bec28 | ||
|
|
0c392684fa | ||
|
|
244c1e9ad1 | ||
|
|
f85cb8d2f7 | ||
|
|
c29be84c26 | ||
|
|
425914e43d | ||
|
|
6bfef39da0 | ||
|
|
a7d9607b7a | ||
|
|
5dfa048f04 | ||
|
|
3f497c7991 | ||
|
|
44b5594756 | ||
|
|
d7baf6fc35 | ||
|
|
907ff19190 | ||
|
|
2aee4a7692 | ||
|
|
65d318f307 | ||
|
|
9a99a6ce3c | ||
|
|
58ddf7abf4 | ||
|
|
a803a6c13b | ||
|
|
77c99edbd8 | ||
|
|
8efcea0172 | ||
|
|
9c121d2651 | ||
|
|
06d4d4f9c5 | ||
|
|
bcbfdfa370 | ||
|
|
cf26dcd241 | ||
|
|
891b4cf513 | ||
|
|
23dc95f80a | ||
|
|
85fc119179 | ||
|
|
169518553e | ||
|
|
6cd8c381b5 | ||
|
|
74266b6c30 | ||
|
|
231a8f6989 | ||
|
|
6180288a7a | ||
|
|
9ed96de5a6 | ||
|
|
a81085e7b7 | ||
|
|
88a656ec70 | ||
|
|
e953529b5d | ||
|
|
7ffbfde627 | ||
|
|
9dfc190714 | ||
|
|
af52fd45f1 | ||
|
|
4f010e9218 | ||
|
|
8cffdc299f | ||
|
|
02e572c000 | ||
|
|
3a092d3ae6 | ||
|
|
15d1f659a4 | ||
|
|
272b8e43ac | ||
|
|
1ea0595e59 | ||
|
|
a14d588673 | ||
|
|
fd81fe325f | ||
|
|
baa57dd092 | ||
|
|
465ae3c5e5 | ||
|
|
fad42bb2d7 | ||
|
|
d8bc8410b0 | ||
|
|
0b2e876d7d | ||
|
|
8f80ba860d | ||
|
|
cb509b2318 | ||
|
|
c1e972f199 | ||
|
|
d8e44207ed | ||
|
|
acb1d52fe4 | ||
|
|
2fa3a6935e | ||
|
|
8d9c0d1209 | ||
|
|
1d709ef0af | ||
|
|
f1f7466a72 | ||
|
|
a36a691826 | ||
|
|
9816215ea7 | ||
|
|
294698153c | ||
|
|
db4ddc5f68 | ||
|
|
9c75c8235e | ||
|
|
d854696ec9 | ||
|
|
98f59fb96c | ||
|
|
734f0957fb | ||
|
|
c789882a29 | ||
|
|
f9ad625822 | ||
|
|
c43a68113f | ||
|
|
e869b44d0f | ||
|
|
93eee35e84 | ||
|
|
ad134c48d6 | ||
|
|
e4643f5bed | ||
|
|
bcc531f53b | ||
|
|
007b998b23 | ||
|
|
2637007c78 | ||
|
|
3dfad03649 | ||
|
|
190e7bd30a | ||
|
|
292ece5fde | ||
|
|
ccc8c3b988 | ||
|
|
d53992cc12 | ||
|
|
6f7a751520 | ||
|
|
037fb1d123 | ||
|
|
706d07b3d5 | ||
|
|
eb7be8c637 | ||
|
|
080c8cc134 | ||
|
|
8e81d25f5d | ||
|
|
0cfefdfd42 | ||
|
|
ad321f50d9 | ||
|
|
cd8c5dae0c | ||
|
|
7f99af4101 | ||
|
|
e6f9b29951 | ||
|
|
7181c37a39 | ||
|
|
6e0ec4b5bc | ||
|
|
ab51260232 | ||
|
|
34cadf6068 | ||
|
|
087aa28bc7 | ||
|
|
d0d212143a | ||
|
|
05abfd8200 | ||
|
|
a8a9d2cbd4 | ||
|
|
c87116b332 | ||
|
|
e29ae4e08c | ||
|
|
865d49bdc1 | ||
|
|
9074b8d943 | ||
|
|
01c37ba21f | ||
|
|
b886cfadff | ||
|
|
73169b6863 | ||
|
|
7a9e29d580 | ||
|
|
98cb21f1bd | ||
|
|
8a11926150 | ||
|
|
6652764751 | ||
|
|
d16bc65a16 | ||
|
|
dc93e309e2 | ||
|
|
fc1697622c | ||
|
|
ecb8ae6aba |
No files matched your search
@@ -7,6 +7,10 @@
|
||||
* ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule)
|
||||
*/
|
||||
|
||||
#ifndef NSAccessibilityCellRole
|
||||
#define NSAccessibilityCellRole NSAccessibilityUnknownRole
|
||||
#endif
|
||||
|
||||
ROLE(NOTHING,
|
||||
"nothing",
|
||||
ATK_ROLE_UNKNOWN,
|
||||
|
||||
@@ -44,7 +44,9 @@
|
||||
#ifdef XP_WIN
|
||||
#include "mozilla/a11y/Compatibility.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
#include "HTMLWin32ObjectAccessible.h"
|
||||
#endif
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#endif
|
||||
|
||||
@@ -55,7 +57,9 @@
|
||||
#include "nsImageFrame.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
#include "nsPluginFrame.h"
|
||||
#endif
|
||||
#include "nsSVGPathGeometryFrame.h"
|
||||
#include "nsTreeBodyFrame.h"
|
||||
#include "nsTreeColumns.h"
|
||||
@@ -79,7 +83,7 @@
|
||||
#include "XULTabAccessible.h"
|
||||
#include "XULTreeGridAccessibleWrap.h"
|
||||
|
||||
#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
|
||||
#if (defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)) && defined(MOZ_ENABLE_NPAPI)
|
||||
#include "nsNPAPIPluginInstance.h"
|
||||
#endif
|
||||
|
||||
@@ -431,6 +435,7 @@ private:
|
||||
NS_IMPL_ISUPPORTS(PluginTimerCallBack, nsITimerCallback)
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
|
||||
nsIContent* aContent,
|
||||
@@ -493,6 +498,7 @@ nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
#endif // MOZ_ENABLE_NPAPI
|
||||
|
||||
void
|
||||
nsAccessibilityService::DeckPanelSwitched(nsIPresShell* aPresShell,
|
||||
@@ -1638,11 +1644,13 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
|
||||
case eOuterDocType:
|
||||
newAcc = new OuterDocAccessible(aContent, document);
|
||||
break;
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
case ePluginType: {
|
||||
nsPluginFrame* pluginFrame = do_QueryFrame(aFrame);
|
||||
newAcc = CreatePluginAccessible(pluginFrame, aContent, aContext);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case eTextLeafType:
|
||||
newAcc = new TextLeafAccessibleWrap(aContent, document);
|
||||
break;
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
class nsImageFrame;
|
||||
class nsIArray;
|
||||
class nsIPersistentProperties;
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
class nsPluginFrame;
|
||||
#endif
|
||||
class nsITreeView;
|
||||
|
||||
namespace mozilla {
|
||||
@@ -87,9 +89,11 @@ public:
|
||||
|
||||
Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
bool aCanCreate);
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
already_AddRefed<Accessible>
|
||||
CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent,
|
||||
Accessible* aContext);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Adds/remove ATK root accessible for gtk+ native window to/from children
|
||||
|
||||
@@ -486,13 +486,14 @@ DocAccessibleParent::SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy)
|
||||
IAccessibleHolder holder(Move(ptr));
|
||||
Unused << SendParentCOMProxy(holder);
|
||||
}
|
||||
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
bool
|
||||
DocAccessibleParent::RecvGetWindowedPluginIAccessible(
|
||||
const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
|
||||
@@ -143,10 +143,11 @@ public:
|
||||
|
||||
#if defined(XP_WIN)
|
||||
void SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy);
|
||||
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
virtual bool RecvGetWindowedPluginIAccessible(
|
||||
const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy) override;
|
||||
#endif
|
||||
#endif // MOZ_ENABLE_NPAPI
|
||||
#endif // XP_WIN
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -61,8 +61,10 @@ parent:
|
||||
*/
|
||||
async BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
|
||||
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
sync GetWindowedPluginIAccessible(WindowsHandle aHwnd)
|
||||
returns (IAccessibleHolder aPluginCOMProxy);
|
||||
#endif
|
||||
|
||||
child:
|
||||
async ParentCOMProxy(IAccessibleHolder aParentCOMProxy);
|
||||
|
||||
@@ -8,7 +8,7 @@ if CONFIG['COMPILE_ENVIRONMENT']:
|
||||
|
||||
# With --disable-accessibility, we need to compile PDocAccessible.ipdl (which
|
||||
# also depends on COMPtrTypes.h), but not the C++.
|
||||
IPDL_SOURCES += ['PDocAccessible.ipdl']
|
||||
PREPROCESSED_IPDL_SOURCES += ['PDocAccessible.ipdl']
|
||||
EXPORTS.mozilla.a11y += ['COMPtrTypes.h']
|
||||
|
||||
if CONFIG['ACCESSIBILITY']:
|
||||
|
||||
@@ -295,6 +295,7 @@ enum CheckboxValue {
|
||||
|
||||
@implementation mozPaneAccessible
|
||||
|
||||
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
- (NSUInteger)accessibilityArrayAttributeCount:(NSString*)attribute
|
||||
{
|
||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||
@@ -313,6 +314,7 @@ enum CheckboxValue {
|
||||
|
||||
return [super accessibilityArrayAttributeCount:attribute];
|
||||
}
|
||||
#endif
|
||||
|
||||
- (NSArray*)children
|
||||
{
|
||||
|
||||
@@ -47,6 +47,24 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
return nativeArray;
|
||||
}
|
||||
|
||||
// Convert to an object without @ syntax
|
||||
static inline id
|
||||
ConvertToId(NSInteger val)
|
||||
{
|
||||
return [NSString stringWithFormat:@"%i", val];
|
||||
}
|
||||
|
||||
// Missing from SDK 10.5
|
||||
#if !defined(MAC_OS_X_VERSION_10_6) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
|
||||
#define __IntToNSString(x) ([NSString stringWithFormat:@"%i", x])
|
||||
#define NSAccessibilityRowIndexRangeAttribute @"AXRowIndexRange"
|
||||
#define NSAccessibilityColumnIndexRangeAttribute @"AXColumnIndexRange"
|
||||
#define NSAccessibilityRowHeaderUIElementsAttribute @"AXRowHeaderUIElements"
|
||||
#define NSAccessibilityColumnHeaderUIElementsAttribute @"AXColumnHeaderUIElements"
|
||||
#define NSAccessibilityRowCountAttribute @"AXRowCount"
|
||||
#define NSAccessibilityColumnCountAttribute @"AXColumnCount"
|
||||
#endif
|
||||
|
||||
@implementation mozTablePartAccessible
|
||||
- (BOOL)isLayoutTablePart;
|
||||
{
|
||||
@@ -83,10 +101,14 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
||||
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
|
||||
if ([self isLayoutTablePart]) {
|
||||
return additionalAttributes;
|
||||
}
|
||||
#else
|
||||
NSArray* additionalAttributes = [[NSArray alloc] init];
|
||||
#endif
|
||||
|
||||
static NSArray* tableAttrs = nil;
|
||||
if (!tableAttrs) {
|
||||
@@ -108,9 +130,9 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
if (AccessibleWrap* accWrap = [self getGeckoAccessible]) {
|
||||
TableAccessible* table = accWrap->AsTable();
|
||||
if ([attribute isEqualToString:NSAccessibilityRowCountAttribute])
|
||||
return @(table->RowCount());
|
||||
return ConvertToId(table->RowCount());
|
||||
if ([attribute isEqualToString:NSAccessibilityColumnCountAttribute])
|
||||
return @(table->ColCount());
|
||||
return ConvertToId(table->ColCount());
|
||||
if ([attribute isEqualToString:NSAccessibilityRowsAttribute]) {
|
||||
// Create a new array with the list of table rows.
|
||||
NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
|
||||
@@ -127,9 +149,9 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
}
|
||||
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
|
||||
if ([attribute isEqualToString:NSAccessibilityRowCountAttribute])
|
||||
return @(proxy->TableRowCount());
|
||||
return ConvertToId(proxy->TableRowCount());
|
||||
if ([attribute isEqualToString:NSAccessibilityColumnCountAttribute])
|
||||
return @(proxy->TableColumnCount());
|
||||
return ConvertToId(proxy->TableColumnCount());
|
||||
if ([attribute isEqualToString:NSAccessibilityRowsAttribute]) {
|
||||
// Create a new array with the list of table rows.
|
||||
NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
|
||||
@@ -155,10 +177,14 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
||||
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
|
||||
if ([self isLayoutTablePart]) {
|
||||
return additionalAttributes;
|
||||
}
|
||||
#else
|
||||
NSArray* additionalAttributes = [[NSArray alloc] init];
|
||||
#endif
|
||||
|
||||
static NSArray* tableRowAttrs = nil;
|
||||
if (!tableRowAttrs) {
|
||||
@@ -214,10 +240,14 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
||||
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
|
||||
if ([self isLayoutTablePart]) {
|
||||
return additionalAttributes;
|
||||
}
|
||||
#else
|
||||
NSArray* additionalAttributes = [[NSArray alloc] init];
|
||||
#endif
|
||||
|
||||
static NSArray* tableCellAttrs = nil;
|
||||
if (!tableCellAttrs) {
|
||||
|
||||
@@ -38,6 +38,13 @@ SOURCES += [
|
||||
'XULTreeGridAccessibleWrap.cpp',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_ENABLE_NPAPI']:
|
||||
SOURCES += [
|
||||
'HTMLWin32ObjectAccessible.cpp',
|
||||
]
|
||||
|
||||
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/accessible/base',
|
||||
'/accessible/generic',
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,80 @@
|
||||
dnl Map old names of Autoconf macros to new regularized names.
|
||||
dnl This file is part of Autoconf.
|
||||
dnl Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2, or (at your option)
|
||||
dnl any later version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
dnl 02111-1307, USA.
|
||||
dnl
|
||||
dnl General macros.
|
||||
dnl
|
||||
define(AC_WARN, [indir([AC_MSG_WARN], $@)])dnl
|
||||
define(AC_ERROR, [indir([AC_MSG_ERROR], $@)])dnl
|
||||
AC_DEFUN(AC_PROGRAM_CHECK, [indir([AC_CHECK_PROG], $@)])dnl
|
||||
AC_DEFUN(AC_PROGRAM_PATH, [indir([AC_PATH_PROG], $@)])dnl
|
||||
AC_DEFUN(AC_PROGRAMS_CHECK, [indir([AC_CHECK_PROGS], $@)])dnl
|
||||
AC_DEFUN(AC_PROGRAMS_PATH, [indir([AC_PATH_PROGS], $@)])dnl
|
||||
AC_DEFUN(AC_PREFIX, [indir([AC_PREFIX_PROGRAM], $@)])dnl
|
||||
AC_DEFUN(AC_HEADER_EGREP, [indir([AC_EGREP_HEADER], $@)])dnl
|
||||
AC_DEFUN(AC_PROGRAM_EGREP, [indir([AC_EGREP_CPP], $@)])dnl
|
||||
AC_DEFUN(AC_TEST_PROGRAM, [indir([AC_TRY_RUN], $@)])dnl
|
||||
AC_DEFUN(AC_TEST_CPP, [indir([AC_TRY_CPP], $@)])dnl
|
||||
AC_DEFUN(AC_HEADER_CHECK, [indir([AC_CHECK_HEADER], $@)])dnl
|
||||
AC_DEFUN(AC_FUNC_CHECK, [indir([AC_CHECK_FUNC], $@)])dnl
|
||||
AC_DEFUN(AC_HAVE_FUNCS, [indir([AC_CHECK_FUNCS], $@)])dnl
|
||||
AC_DEFUN(AC_HAVE_HEADERS, [indir([AC_CHECK_HEADERS], $@)])dnl
|
||||
AC_DEFUN(AC_SIZEOF_TYPE, [indir([AC_CHECK_SIZEOF], $@)])dnl
|
||||
dnl
|
||||
dnl Specific macros.
|
||||
dnl
|
||||
AC_DEFUN(AC_GCC_TRADITIONAL, [indir([AC_PROG_GCC_TRADITIONAL])])dnl
|
||||
AC_DEFUN(AC_MINUS_C_MINUS_O, [indir([AC_PROG_CC_C_O])])dnl
|
||||
AC_DEFUN(AC_SET_MAKE, [indir([AC_PROG_MAKE_SET])])dnl
|
||||
AC_DEFUN(AC_YYTEXT_POINTER, [indir([AC_DECL_YYTEXT])])dnl
|
||||
AC_DEFUN(AC_LN_S, [indir([AC_PROG_LN_S])])dnl
|
||||
AC_DEFUN(AC_STDC_HEADERS, [indir([AC_HEADER_STDC])])dnl
|
||||
AC_DEFUN(AC_MAJOR_HEADER, [indir([AC_HEADER_MAJOR])])dnl
|
||||
AC_DEFUN(AC_STAT_MACROS_BROKEN, [indir([AC_HEADER_STAT])])dnl
|
||||
AC_DEFUN(AC_SYS_SIGLIST_DECLARED, [indir([AC_DECL_SYS_SIGLIST])])dnl
|
||||
AC_DEFUN(AC_GETGROUPS_T, [indir([AC_TYPE_GETGROUPS])])dnl
|
||||
AC_DEFUN(AC_UID_T, [indir([AC_TYPE_UID_T])])dnl
|
||||
AC_DEFUN(AC_SIZE_T, [indir([AC_TYPE_SIZE_T])])dnl
|
||||
AC_DEFUN(AC_PID_T, [indir([AC_TYPE_PID_T])])dnl
|
||||
AC_DEFUN(AC_OFF_T, [indir([AC_TYPE_OFF_T])])dnl
|
||||
AC_DEFUN(AC_MODE_T, [indir([AC_TYPE_MODE_T])])dnl
|
||||
AC_DEFUN(AC_RETSIGTYPE, [indir([AC_TYPE_SIGNAL])])dnl
|
||||
AC_DEFUN(AC_MMAP, [indir([AC_FUNC_MMAP])])dnl
|
||||
AC_DEFUN(AC_VPRINTF, [indir([AC_FUNC_VPRINTF])])dnl
|
||||
AC_DEFUN(AC_VFORK, [indir([AC_FUNC_VFORK])])dnl
|
||||
AC_DEFUN(AC_WAIT3, [indir([AC_FUNC_WAIT3])])dnl
|
||||
AC_DEFUN(AC_ALLOCA, [indir([AC_FUNC_ALLOCA])])dnl
|
||||
AC_DEFUN(AC_GETLOADAVG, [indir([AC_FUNC_GETLOADAVG])])dnl
|
||||
AC_DEFUN(AC_UTIME_NULL, [indir([AC_FUNC_UTIME_NULL])])dnl
|
||||
AC_DEFUN(AC_STRCOLL, [indir([AC_FUNC_STRCOLL])])dnl
|
||||
AC_DEFUN(AC_SETVBUF_REVERSED, [indir([AC_FUNC_SETVBUF_REVERSED])])dnl
|
||||
AC_DEFUN(AC_TIME_WITH_SYS_TIME, [indir([AC_HEADER_TIME])])dnl
|
||||
AC_DEFUN(AC_TIMEZONE, [indir([AC_STRUCT_TIMEZONE])])dnl
|
||||
AC_DEFUN(AC_ST_BLOCKS, [indir([AC_STRUCT_ST_BLOCKS])])dnl
|
||||
AC_DEFUN(AC_ST_BLKSIZE, [indir([AC_STRUCT_ST_BLKSIZE])])dnl
|
||||
AC_DEFUN(AC_ST_RDEV, [indir([AC_STRUCT_ST_RDEV])])dnl
|
||||
AC_DEFUN(AC_CROSS_CHECK, [indir([AC_C_CROSS])])dnl
|
||||
AC_DEFUN(AC_CHAR_UNSIGNED, [indir([AC_C_CHAR_UNSIGNED])])dnl
|
||||
AC_DEFUN(AC_LONG_DOUBLE, [indir([AC_C_LONG_DOUBLE])])dnl
|
||||
AC_DEFUN(AC_WORDS_BIGENDIAN, [indir([AC_C_BIGENDIAN])])dnl
|
||||
AC_DEFUN(AC_INLINE, [indir([AC_C_INLINE])])dnl
|
||||
AC_DEFUN(AC_CONST, [indir([AC_C_CONST])])dnl
|
||||
AC_DEFUN(AC_LONG_FILE_NAMES, [indir([AC_SYS_LONG_FILE_NAMES])])dnl
|
||||
AC_DEFUN(AC_RESTARTABLE_SYSCALLS, [indir([AC_SYS_RESTARTABLE_SYSCALLS])])dnl
|
||||
AC_DEFUN(AC_FIND_X, [indir([AC_PATH_X])])dnl
|
||||
AC_DEFUN(AC_FIND_XTRA, [indir([AC_PATH_XTRA])])dnl
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,28 @@
|
||||
dnl Driver that loads the Autoconf macro files.
|
||||
dnl Requires GNU m4.
|
||||
dnl This file is part of Autoconf.
|
||||
dnl Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2, or (at your option)
|
||||
dnl any later version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
dnl 02111-1307, USA.
|
||||
dnl
|
||||
dnl Written by David MacKenzie.
|
||||
dnl
|
||||
include(acgeneral.m4)dnl
|
||||
builtin(include, acspecific.m4)dnl
|
||||
builtin(include, acoldnames.m4)dnl
|
||||
dnl Do not sinclude acsite.m4 here, because it may not be installed
|
||||
dnl yet when Autoconf is frozen.
|
||||
dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
|
||||
Executable
+159
@@ -0,0 +1,159 @@
|
||||
#! @SHELL@
|
||||
# autoconf -- create `configure' using m4 macros
|
||||
# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# If given no args, create `configure' from template file `configure.in'.
|
||||
# With one arg, create a configure script on standard output from
|
||||
# the given template file.
|
||||
|
||||
usage="\
|
||||
Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
|
||||
[-l dir] [--localdir=dir] [--version] [template-file]"
|
||||
|
||||
# NLS nuisances.
|
||||
# Only set these to C if already set. These must not be set unconditionally
|
||||
# because not all systems understand e.g. LANG=C (notably SCO).
|
||||
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
|
||||
# Non-C LC_CTYPE values break the ctype check.
|
||||
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
|
||||
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
|
||||
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
|
||||
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
|
||||
|
||||
: ${AC_MACRODIR=@datadir@}
|
||||
: ${M4=@M4@}
|
||||
: ${AWK=@AWK@}
|
||||
case "${M4}" in
|
||||
/*) # Handle the case that m4 has moved since we were configured.
|
||||
# It may have been found originally in a build directory.
|
||||
test -f "${M4}" || M4=m4 ;;
|
||||
esac
|
||||
|
||||
: ${TMPDIR=/tmp}
|
||||
tmpout=${TMPDIR}/acout.$$
|
||||
localdir=
|
||||
show_version=no
|
||||
|
||||
while test $# -gt 0 ; do
|
||||
case "${1}" in
|
||||
-h | --help | --h* )
|
||||
echo "${usage}" 1>&2; exit 0 ;;
|
||||
--localdir=* | --l*=* )
|
||||
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
|
||||
shift ;;
|
||||
-l | --localdir | --l*)
|
||||
shift
|
||||
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
|
||||
localdir="${1}"
|
||||
shift ;;
|
||||
--macrodir=* | --m*=* )
|
||||
AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
|
||||
shift ;;
|
||||
-m | --macrodir | --m* )
|
||||
shift
|
||||
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
|
||||
AC_MACRODIR="${1}"
|
||||
shift ;;
|
||||
--version | --v* )
|
||||
show_version=yes; shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
- ) # Use stdin as input.
|
||||
break ;;
|
||||
-* )
|
||||
echo "${usage}" 1>&2; exit 1 ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $show_version = yes; then
|
||||
version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
|
||||
$AC_MACRODIR/acgeneral.m4`
|
||||
echo "Autoconf version $version"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case $# in
|
||||
0) infile=configure.in ;;
|
||||
1) infile="$1" ;;
|
||||
*) echo "$usage" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15
|
||||
|
||||
tmpin=${TMPDIR}/acin.$$ # Always set this, to avoid bogus errors from some rm's.
|
||||
if test z$infile = z-; then
|
||||
infile=$tmpin
|
||||
cat > $infile
|
||||
elif test ! -r "$infile"; then
|
||||
echo "autoconf: ${infile}: No such file or directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -n "$localdir"; then
|
||||
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
|
||||
else
|
||||
use_localdir=
|
||||
fi
|
||||
|
||||
# Use the frozen version of Autoconf if available.
|
||||
r= f=
|
||||
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
|
||||
case `$M4 --help < /dev/null 2>&1` in
|
||||
*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
|
||||
*traditional*) ;;
|
||||
*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
|
||||
esac
|
||||
|
||||
$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
|
||||
{ rm -f $tmpin $tmpout; exit 2; }
|
||||
|
||||
# You could add your own prefixes to pattern if you wanted to check for
|
||||
# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do
|
||||
# alternation.
|
||||
pattern="AC_"
|
||||
|
||||
status=0
|
||||
if grep "^[^#]*${pattern}" $tmpout > /dev/null 2>&1; then
|
||||
echo "autoconf: Undefined macros:" >&2
|
||||
sed -n "s/^[^#]*\\(${pattern}[_A-Za-z0-9]*\\).*/\\1/p" $tmpout |
|
||||
while read macro; do
|
||||
grep -n "^[^#]*$macro" $infile /dev/null
|
||||
test $? -eq 1 && echo >&2 "***BUG in Autoconf--please report*** $macro"
|
||||
done | sort -u >&2
|
||||
status=1
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
exec 4> configure; chmod +x configure
|
||||
else
|
||||
exec 4>&1
|
||||
fi
|
||||
|
||||
# Put the real line numbers into configure to make config.log more helpful.
|
||||
$AWK '
|
||||
/__oline__/ { printf "%d:", NR + 1 }
|
||||
{ print }
|
||||
' $tmpout | sed '
|
||||
/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
|
||||
' >&4
|
||||
|
||||
rm -f $tmpout
|
||||
|
||||
exit $status
|
||||
@@ -179,10 +179,12 @@ if test "$GNU_CC"; then
|
||||
CFLAGS="$CFLAGS -fno-math-errno -pipe"
|
||||
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -pipe"
|
||||
|
||||
if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then
|
||||
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
|
||||
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
|
||||
fi
|
||||
case "${host_cpu}" in
|
||||
i*86)
|
||||
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
|
||||
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$CLANG_CC"; then
|
||||
case "$CC_VERSION" in
|
||||
@@ -190,9 +192,9 @@ if test "$GNU_CC"; then
|
||||
AC_MSG_ERROR([Unsupported GCC version.])
|
||||
;;
|
||||
*)
|
||||
# Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko.
|
||||
# Instead of completely disabling this optimization on newer GCC's,
|
||||
# we'll force them to use level 1 optimization with -flifetime-dse=1.
|
||||
# Lifetime Dead Store Elimination level 2 (default in GCC) breaks Goanna.
|
||||
# Instead of completely disabling this optimization, we force level 1
|
||||
# optimization instead with -flifetime-dse=1.
|
||||
# Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS.
|
||||
CFLAGS="-flifetime-dse=1 $CFLAGS"
|
||||
CXXFLAGS="-flifetime-dse=1 $CXXFLAGS"
|
||||
|
||||
@@ -28,9 +28,7 @@ if test -n "$USE_ICU"; then
|
||||
fi
|
||||
MOZ_ICU_VERSION="$version"
|
||||
|
||||
# TODO: the l is actually endian-dependent
|
||||
# We could make this set as 'l' or 'b' for little or big, respectively,
|
||||
# but we'd need to check in a big-endian version of the file.
|
||||
ICU_DATA_FILE_BIG="icudt${version}b.dat"
|
||||
ICU_DATA_FILE="icudt${version}l.dat"
|
||||
|
||||
dnl We won't build ICU data as a separate file when building
|
||||
@@ -46,6 +44,7 @@ fi
|
||||
|
||||
AC_SUBST(MOZ_ICU_VERSION)
|
||||
AC_SUBST(USE_ICU)
|
||||
AC_SUBST(ICU_DATA_FILE_BIG)
|
||||
AC_SUBST(ICU_DATA_FILE)
|
||||
AC_SUBST(MOZ_ICU_DATA_ARCHIVE)
|
||||
AC_SUBST(MOZ_SHARED_ICU)
|
||||
|
||||
@@ -33,10 +33,3 @@ endif
|
||||
# correctly. Note that the binary produced here is a host tool and doesn't need
|
||||
# to be distributed.
|
||||
MACOSX_DEPLOYMENT_TARGET :=
|
||||
|
||||
# Temporarily relax the requirements for libstdc++ symbol versions on static
|
||||
# analysis plugin in order to use a recent clang by accepting libstdc++ from
|
||||
# gcc 4.4.0 (GLIBCXX_3.4.11).
|
||||
ifdef CHECK_STDCXX
|
||||
CHECK_STDCXX = $(call CHECK_SYMBOLS,$(1),GLIBCXX,libstdc++,v[1] > 3 || (v[1] == 3 && v[2] == 4 && v[3] > 11))
|
||||
endif
|
||||
@@ -499,6 +499,14 @@ set_config('INTEL_ARCHITECTURE', delayed_getattr(target_variables,
|
||||
'INTEL_ARCHITECTURE'))
|
||||
set_config('TARGET_CPU', delayed_getattr(target, 'raw_cpu'))
|
||||
set_config('TARGET_OS', delayed_getattr(target, 'raw_os'))
|
||||
set_config('TARGET_ENDIANNESS', delayed_getattr(target, 'endianness'))
|
||||
|
||||
@depends(target)
|
||||
def target_is_big_endian(target):
|
||||
if target.endianness == 'big':
|
||||
return True
|
||||
|
||||
set_define('TARGET_ENDIAN_BIG', target_is_big_endian)
|
||||
|
||||
|
||||
@depends(host)
|
||||
@@ -591,7 +599,9 @@ imply_option('--enable-project', application)
|
||||
|
||||
@depends(check_build_environment, '--help')
|
||||
def default_project(build_env, help):
|
||||
return 'js'
|
||||
if build_env.topobjdir.endswith('/js/src'):
|
||||
return 'js'
|
||||
return 'xulrunner'
|
||||
|
||||
option('--enable-project', nargs=1, default=default_project,
|
||||
help='Project to build')
|
||||
@@ -638,7 +648,7 @@ def build_project(noncomm_build, project, external_source_dir, build_env, help):
|
||||
|
||||
build_app = project[0]
|
||||
|
||||
if not external_source_dir and build_app not in ('js'):
|
||||
if not external_source_dir and build_app not in ('xulrunner', 'js'):
|
||||
if noncomm_build:
|
||||
log.info("=====WARNING WARNING WARNING=====")
|
||||
log.info("UNSUPPORTED NONCOMM-BUILD: Application code SHOULD NOT be put inside the platform tree, and doing so may have unforseen consequences if/when platform code is changed.")
|
||||
|
||||
@@ -10,66 +10,28 @@ def encoded_open(path, mode):
|
||||
return codecs.open(path, mode, encoding)
|
||||
|
||||
|
||||
option(env='AUTOCONF', nargs=1, help='Path to autoconf 2.13')
|
||||
m4 = check_prog(
|
||||
"M4",
|
||||
(
|
||||
"gm4",
|
||||
"m4",
|
||||
),
|
||||
)
|
||||
|
||||
@depends(mozconfig, 'AUTOCONF')
|
||||
@checking('for autoconf')
|
||||
@imports(_from='os.path', _import='exists')
|
||||
@imports('re')
|
||||
def autoconf(mozconfig, autoconf):
|
||||
mozconfig_autoconf = None
|
||||
if mozconfig['path']:
|
||||
make_extra = mozconfig['make_extra']
|
||||
if make_extra:
|
||||
for assignment in make_extra:
|
||||
m = re.match('(?:export\s+)?AUTOCONF\s*:?=\s*(.+)$',
|
||||
assignment)
|
||||
if m:
|
||||
mozconfig_autoconf = m.group(1)
|
||||
|
||||
autoconf = autoconf[0] if autoconf else None
|
||||
|
||||
for ac in (mozconfig_autoconf, autoconf, 'autoconf-2.13', 'autoconf2.13',
|
||||
'autoconf213'):
|
||||
if ac:
|
||||
autoconf = find_program(ac)
|
||||
if autoconf:
|
||||
break
|
||||
else:
|
||||
fink = find_program('fink')
|
||||
if fink:
|
||||
autoconf = os.path.normpath(os.path.join(
|
||||
fink, '..', '..', 'lib', 'autoconf2.13', 'bin', 'autoconf'))
|
||||
else:
|
||||
brew = find_program('brew')
|
||||
if brew:
|
||||
autoconf = os.path.normpath(os.path.join(
|
||||
brew, '..', '..', 'Cellar', 'autoconf213', '2.13', 'bin',
|
||||
'autoconf213'))
|
||||
|
||||
if not autoconf:
|
||||
die('Could not find autoconf 2.13')
|
||||
|
||||
if not exists(autoconf):
|
||||
die('Could not find autoconf 2.13 at %s', autoconf)
|
||||
|
||||
return autoconf
|
||||
|
||||
set_config('AUTOCONF', autoconf)
|
||||
|
||||
|
||||
@depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
|
||||
@depends('OLD_CONFIGURE', mozconfig, awk, m4, check_build_environment, shell,
|
||||
old_configure_assignments, build_project)
|
||||
@imports(_from='__builtin__', _import='open')
|
||||
@imports(_from='__builtin__', _import='print')
|
||||
@imports('glob')
|
||||
@imports('sys')
|
||||
@imports('itertools')
|
||||
@imports('subprocess')
|
||||
# Import getmtime without overwriting the sandbox os.path.
|
||||
@imports(_from='os.path', _import='getmtime')
|
||||
@imports(_from='os.path', _import='exists')
|
||||
@imports(_from='mozbuild.shellutil', _import='quote')
|
||||
def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
|
||||
@imports(_from='os', _import='environ')
|
||||
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
|
||||
old_configure_assignments, build_project):
|
||||
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
|
||||
# which is actually necessary because this path actually ends up literally
|
||||
@@ -98,11 +60,22 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
|
||||
refresh = False
|
||||
|
||||
if refresh:
|
||||
autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
|
||||
log.info('Refreshing %s with %s', old_configure, autoconf)
|
||||
env = dict(environ)
|
||||
env['M4'] = m4
|
||||
env['AWK'] = awk
|
||||
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
|
||||
my_env = env
|
||||
# Handle Python 2.7 not allowing unicode in the environment on Windows
|
||||
if sys.platform == 'win32':
|
||||
my_env = dict()
|
||||
for e in env:
|
||||
my_env[e.encode('ascii','ignore')] = env[e].encode('ascii','ignore')
|
||||
script = subprocess.check_output([
|
||||
shell, autoconf,
|
||||
'--localdir=%s' % os.path.dirname(old_configure),
|
||||
old_configure + '.in'])
|
||||
old_configure + '.in'], env=my_env)
|
||||
|
||||
# Make old-configure append to config.log, where we put our own log.
|
||||
# This could be done with a m4 macro, but it's way easier this way
|
||||
@@ -127,10 +100,6 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
|
||||
for key in mozconfig[t]['removed'].keys():
|
||||
inject("unset %s" % key)
|
||||
|
||||
# Autoconf is special, because it might be passed from
|
||||
# mozconfig['make_extra'], which we don't pass automatically above.
|
||||
inject('export AUTOCONF=%s' % quote(autoconf))
|
||||
|
||||
for assignment in old_configure_assignments:
|
||||
inject(assignment)
|
||||
|
||||
@@ -207,6 +176,7 @@ def old_configure_options(*options):
|
||||
'--enable-necko-wifi',
|
||||
'--enable-negotiateauth',
|
||||
'--enable-nfc',
|
||||
'--enable-npapi',
|
||||
'--enable-nspr-build',
|
||||
'--enable-official-branding',
|
||||
'--enable-official-vendor',
|
||||
@@ -235,7 +205,6 @@ def old_configure_options(*options):
|
||||
'--enable-small-chunk-size',
|
||||
'--enable-startup-notification',
|
||||
'--enable-startupcache',
|
||||
'--enable-stdcxx-compat',
|
||||
'--enable-strip',
|
||||
'--enable-synth-pico',
|
||||
'--enable-system-cairo',
|
||||
@@ -299,6 +268,7 @@ def old_configure_options(*options):
|
||||
'--with-thumb-interwork',
|
||||
'--with-unify-dist',
|
||||
'--with-user-appdir',
|
||||
'--with-xulrunner-stub-name',
|
||||
'--x-includes',
|
||||
'--x-libraries',
|
||||
|
||||
@@ -311,6 +281,7 @@ def old_configure_options(*options):
|
||||
'--enable-incomplete-external-linkage',
|
||||
'--enable-mailnews',
|
||||
'--enable-mailnews-oauth2',
|
||||
'--enable-classic-account-wizard',
|
||||
|
||||
# Below are configure flags used by Pale Moon
|
||||
'--disable-browser-statusbar',
|
||||
|
||||
@@ -8,9 +8,6 @@ def Binary():
|
||||
'''Generic template for target binaries. Meant to be used by other
|
||||
templates.'''
|
||||
|
||||
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
|
||||
USE_LIBS += ['stdc++compat']
|
||||
|
||||
# Ideally, we'd support not adding this to the LIB_IS_C_ONLY case,
|
||||
# but that variable is actually only set in db/sqlite/src, which
|
||||
# doesn't build a shared library on the relevant platforms anyways.
|
||||
@@ -77,27 +74,11 @@ def Framework(name):
|
||||
IS_FRAMEWORK = True
|
||||
|
||||
|
||||
@template
|
||||
def HostStdCppCompat():
|
||||
'''Template for libstdc++ compatibility for host binaries.'''
|
||||
|
||||
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
|
||||
HOST_USE_LIBS += ['host_stdc++compat']
|
||||
|
||||
|
||||
@template
|
||||
def HostProgram(name, c_only=False):
|
||||
'''Template for build tools executables.'''
|
||||
HOST_PROGRAM = name
|
||||
|
||||
# With context-based templates, this won't be needed anymore, and will
|
||||
# work better than relying on the caller setting it, but at the moment,
|
||||
# this is the best we have. And it doesn't matter /that/ much, so there's
|
||||
# really only one place using this, where it does matter to avoid the
|
||||
# extra dependency (because it creates a circular one).
|
||||
if not c_only:
|
||||
HostStdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def HostSimplePrograms(names, ext='.cpp'):
|
||||
@@ -109,8 +90,6 @@ def HostSimplePrograms(names, ext='.cpp'):
|
||||
HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
|
||||
for name in names]
|
||||
|
||||
HostStdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def HostLibrary(name):
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION'] or CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
|
||||
DIRS += ['stdc++compat']
|
||||
|
||||
if CONFIG['USE_ELF_HACK']:
|
||||
DIRS += ['elfhack']
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# Avoid dependency on libstdc++ 4.7
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
|
||||
|
||||
if [ -f "$TOOLTOOL_DIR/clang/lib/libstdc++.so" ]; then
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/clang/lib
|
||||
elif [ -f "$TOOLTOOL_DIR/gcc/lib/libstdc++.so" ]; then
|
||||
# We put both 32-bits and 64-bits library path in LD_LIBRARY_PATH: ld.so
|
||||
# will prefer the files in the 32-bits path when loading 32-bits executables,
|
||||
# and the files in the 64-bits path when loading 64-bits executables.
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/gcc/lib64:$TOOLTOOL_DIR/gcc/lib
|
||||
fi
|
||||
|
||||
mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
|
||||
@@ -30,5 +30,3 @@ ac_add_options --enable-pie
|
||||
ac_add_options --disable-install-strip
|
||||
# -gline-tables-only results in significantly smaller binaries.
|
||||
ac_add_options --enable-debug-symbols="-gline-tables-only"
|
||||
|
||||
. "$topsrcdir/build/unix/mozconfig.stdcxx"
|
||||
@@ -1,7 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
ENABLE_CLANG_PLUGIN :=
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
@@ -1,23 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
|
||||
Library('stdc++compat')
|
||||
SOURCES += ['stdc++compat.cpp']
|
||||
|
||||
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
|
||||
HostLibrary('host_stdc++compat')
|
||||
HOST_SOURCES += [
|
||||
'stdc++compat.cpp',
|
||||
]
|
||||
|
||||
FORCE_STATIC_LIB = True
|
||||
|
||||
NO_PGO = True
|
||||
|
||||
DISABLE_STL_WRAPPING = True
|
||||
|
||||
DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']
|
||||
HOST_DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']
|
||||
@@ -1,78 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <ostream>
|
||||
#include <istream>
|
||||
#include <string>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <mozilla/Assertions.h>
|
||||
|
||||
/* GLIBCXX_3.4.8 is from gcc 4.1.1 (111691)
|
||||
GLIBCXX_3.4.9 is from gcc 4.2.0 (111690)
|
||||
GLIBCXX_3.4.10 is from gcc 4.3.0 (126287)
|
||||
GLIBCXX_3.4.11 is from gcc 4.4.0 (133006)
|
||||
GLIBCXX_3.4.12 is from gcc 4.4.1 (147138)
|
||||
GLIBCXX_3.4.13 is from gcc 4.4.2 (151127)
|
||||
GLIBCXX_3.4.14 is from gcc 4.5.0 (151126)
|
||||
GLIBCXX_3.4.15 is from gcc 4.6.0 (160071)
|
||||
GLIBCXX_3.4.16 is from gcc 4.6.1 (172240)
|
||||
GLIBCXX_3.4.17 is from gcc 4.7.0 (174383)
|
||||
GLIBCXX_3.4.18 is from gcc 4.8.0 (190787)
|
||||
GLIBCXX_3.4.19 is from gcc 4.8.1 (199309)
|
||||
GLIBCXX_3.4.20 is from gcc 4.9.0 (199307)
|
||||
GLIBCXX_3.4.21 is from gcc 5.0 (210290)
|
||||
|
||||
This file adds the necessary compatibility tricks to avoid symbols with
|
||||
version GLIBCXX_3.4.16 and bigger, keeping binary compatibility with
|
||||
libstdc++ 4.6.1.
|
||||
|
||||
*/
|
||||
|
||||
#define GLIBCXX_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c))
|
||||
|
||||
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 20)
|
||||
namespace std {
|
||||
|
||||
/* We shouldn't be throwing exceptions at all, but it sadly turns out
|
||||
we call STL (inline) functions that do. */
|
||||
void __throw_out_of_range_fmt(char const* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[1024]; // That should be big enough.
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
va_end(ap);
|
||||
|
||||
__throw_range_error(buf);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 20)
|
||||
/* Technically, this symbol is not in GLIBCXX_3.4.20, but in CXXABI_1.3.8,
|
||||
but that's equivalent, version-wise. Those calls are added by the compiler
|
||||
itself on `new Class[n]` calls. */
|
||||
extern "C" void
|
||||
__cxa_throw_bad_array_new_length()
|
||||
{
|
||||
MOZ_CRASH();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 21)
|
||||
/* While we generally don't build with exceptions, we have some host tools
|
||||
* that do use them. libstdc++ from GCC 5.0 added exception constructors with
|
||||
* char const* argument. Older versions only have a constructor with
|
||||
* std::string. */
|
||||
namespace std {
|
||||
runtime_error::runtime_error(char const* s)
|
||||
: runtime_error(std::string(s))
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -535,7 +535,8 @@ NS_IMPL_ISUPPORTS(nsScriptSecurityManager,
|
||||
///////////////// Security Checks /////////////////
|
||||
|
||||
bool
|
||||
nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
|
||||
nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx,
|
||||
JS::HandleValue aValue)
|
||||
{
|
||||
MOZ_ASSERT(cx == nsContentUtils::GetCurrentJSContext());
|
||||
nsCOMPtr<nsIPrincipal> subjectPrincipal = nsContentUtils::SubjectPrincipal();
|
||||
@@ -558,12 +559,23 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
|
||||
}
|
||||
|
||||
if (reportViolation) {
|
||||
nsAutoString fileName;
|
||||
unsigned lineNum = 0;
|
||||
NS_NAMED_LITERAL_STRING(scriptSample, "call to eval() or related function blocked by CSP");
|
||||
JS::Rooted<JSString*> jsString(cx, JS::ToString(cx, aValue));
|
||||
if (NS_WARN_IF(!jsString)) {
|
||||
JS_ClearPendingException(cx);
|
||||
return false;
|
||||
}
|
||||
|
||||
nsAutoJSString scriptSample;
|
||||
if (NS_WARN_IF(!scriptSample.init(cx, jsString))) {
|
||||
JS_ClearPendingException(cx);
|
||||
return false;
|
||||
}
|
||||
|
||||
JS::AutoFilename scriptFilename;
|
||||
if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum)) {
|
||||
nsAutoString fileName;
|
||||
unsigned lineNum = 0;
|
||||
unsigned columnNum = 0;
|
||||
if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum, &columnNum)) {
|
||||
if (const char *file = scriptFilename.get()) {
|
||||
CopyUTF8toUTF16(nsDependentCString(file), fileName);
|
||||
}
|
||||
@@ -574,6 +586,7 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
|
||||
fileName,
|
||||
scriptSample,
|
||||
lineNum,
|
||||
columnNum,
|
||||
EmptyString(),
|
||||
EmptyString());
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
|
||||
// Decides, based on CSP, whether or not eval() and stuff can be executed.
|
||||
static bool
|
||||
ContentSecurityPolicyPermitsJSAction(JSContext *cx);
|
||||
ContentSecurityPolicyPermitsJSAction(JSContext *cx, JS::HandleValue aValue);
|
||||
|
||||
static bool
|
||||
JSPrincipalsSubsume(JSPrincipals *first, JSPrincipals *second);
|
||||
|
||||
+5
-33
@@ -526,45 +526,17 @@ EXPAND_MKSHLIB_ARGS += --symbol-order $(SYMBOL_ORDER)
|
||||
endif
|
||||
EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB)
|
||||
|
||||
# $(call CHECK_SYMBOLS,lib,PREFIX,dep_name,test)
|
||||
# Checks that the given `lib` doesn't contain dependency on symbols with a
|
||||
# version starting with `PREFIX`_ and matching the `test`. `dep_name` is only
|
||||
# used for the error message.
|
||||
# `test` is an awk expression using the information in the variable `v` which
|
||||
# contains a list of version items ([major, minor, ...]).
|
||||
define CHECK_SYMBOLS
|
||||
@$(TOOLCHAIN_PREFIX)readelf -sW $(1) | \
|
||||
awk '$$8 ~ /@$(2)_/ { \
|
||||
split($$8,a,"@"); \
|
||||
split(a[2],b,"_"); \
|
||||
split(b[2],v,"."); \
|
||||
if ($(4)) { \
|
||||
if (!found) { \
|
||||
print "TEST-UNEXPECTED-FAIL | check_stdcxx | We do not want these $(3) symbol versions to be used:" \
|
||||
} \
|
||||
print " ",$$8; \
|
||||
found=1 \
|
||||
} \
|
||||
} \
|
||||
END { \
|
||||
if (found) { \
|
||||
exit(1) \
|
||||
} \
|
||||
}'
|
||||
endef
|
||||
|
||||
ifneq (,$(MOZ_LIBSTDCXX_TARGET_VERSION)$(MOZ_LIBSTDCXX_HOST_VERSION))
|
||||
CHECK_STDCXX = $(call CHECK_SYMBOLS,$(1),GLIBCXX,libstdc++,v[1] > 3 || (v[1] == 3 && v[2] == 4 && v[3] > 16))
|
||||
CHECK_GLIBC = $(call CHECK_SYMBOLS,$(1),GLIBC,libc,v[1] > 2 || (v[1] == 2 && v[2] > 12))
|
||||
ifeq ($(OS_ARCH),SunOS)
|
||||
ELF_TEST = elfdump -N .dynamic $(1)
|
||||
else
|
||||
ELF_TEST = $(TOOLCHAIN_PREFIX)readelf -d $(1)
|
||||
endif
|
||||
|
||||
ifeq (,$(filter $(OS_TARGET),WINNT Darwin))
|
||||
CHECK_TEXTREL = @$(TOOLCHAIN_PREFIX)readelf -d $(1) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
|
||||
CHECK_TEXTREL = @$(ELF_TEST) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
|
||||
endif
|
||||
|
||||
define CHECK_BINARY
|
||||
$(call CHECK_GLIBC,$(1))
|
||||
$(call CHECK_STDCXX,$(1))
|
||||
$(call CHECK_TEXTREL,$(1))
|
||||
$(call LOCAL_CHECKS,$(1))
|
||||
$(call CHECK_MOZGLUE_ORDER,$(1))
|
||||
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
Library('freetype')
|
||||
|
||||
if CONFIG['MOZ_TREE_FREETYPE']:
|
||||
USE_LIBS += [
|
||||
'static:/modules/freetype2/.libs/freetype',
|
||||
]
|
||||
else:
|
||||
OS_LIBS += CONFIG['FT2_LIBS']
|
||||
Vendored
+2
@@ -15,3 +15,5 @@ LOCAL_INCLUDES += ['/intl/icu/source/i18n']
|
||||
|
||||
include('../defs.mozbuild')
|
||||
include('sources.mozbuild')
|
||||
|
||||
SOURCES += sources
|
||||
+30
-29
@@ -1,5 +1,5 @@
|
||||
# THIS FILE IS GENERATED BY /intl/icu_sources_data.py DO NOT EDIT
|
||||
SOURCES += [
|
||||
sources = [
|
||||
'/intl/icu/source/common/appendable.cpp',
|
||||
'/intl/icu/source/common/bmpset.cpp',
|
||||
'/intl/icu/source/common/brkeng.cpp',
|
||||
@@ -8,15 +8,12 @@ SOURCES += [
|
||||
'/intl/icu/source/common/bytestream.cpp',
|
||||
'/intl/icu/source/common/bytestrie.cpp',
|
||||
'/intl/icu/source/common/bytestriebuilder.cpp',
|
||||
'/intl/icu/source/common/bytestrieiterator.cpp',
|
||||
'/intl/icu/source/common/caniter.cpp',
|
||||
'/intl/icu/source/common/characterproperties.cpp',
|
||||
'/intl/icu/source/common/chariter.cpp',
|
||||
'/intl/icu/source/common/charstr.cpp',
|
||||
'/intl/icu/source/common/cmemory.cpp',
|
||||
'/intl/icu/source/common/cstr.cpp',
|
||||
'/intl/icu/source/common/cstring.cpp',
|
||||
'/intl/icu/source/common/cwchar.cpp',
|
||||
'/intl/icu/source/common/dictbe.cpp',
|
||||
'/intl/icu/source/common/dictionarydata.cpp',
|
||||
'/intl/icu/source/common/dtintrv.cpp',
|
||||
@@ -24,8 +21,6 @@ SOURCES += [
|
||||
'/intl/icu/source/common/errorcode.cpp',
|
||||
'/intl/icu/source/common/filteredbrk.cpp',
|
||||
'/intl/icu/source/common/filterednormalizer2.cpp',
|
||||
'/intl/icu/source/common/icudataver.cpp',
|
||||
'/intl/icu/source/common/icuplug.cpp',
|
||||
'/intl/icu/source/common/loadednormalizer2impl.cpp',
|
||||
'/intl/icu/source/common/locavailable.cpp',
|
||||
'/intl/icu/source/common/locbased.cpp',
|
||||
@@ -42,9 +37,7 @@ SOURCES += [
|
||||
'/intl/icu/source/common/normlzr.cpp',
|
||||
'/intl/icu/source/common/parsepos.cpp',
|
||||
'/intl/icu/source/common/patternprops.cpp',
|
||||
'/intl/icu/source/common/pluralmap.cpp',
|
||||
'/intl/icu/source/common/propname.cpp',
|
||||
'/intl/icu/source/common/propsvec.cpp',
|
||||
'/intl/icu/source/common/punycode.cpp',
|
||||
'/intl/icu/source/common/putil.cpp',
|
||||
'/intl/icu/source/common/rbbi.cpp',
|
||||
@@ -57,7 +50,6 @@ SOURCES += [
|
||||
'/intl/icu/source/common/rbbistbl.cpp',
|
||||
'/intl/icu/source/common/rbbitblb.cpp',
|
||||
'/intl/icu/source/common/resbund.cpp',
|
||||
'/intl/icu/source/common/resbund_cnv.cpp',
|
||||
'/intl/icu/source/common/resource.cpp',
|
||||
'/intl/icu/source/common/ruleiter.cpp',
|
||||
'/intl/icu/source/common/schriter.cpp',
|
||||
@@ -77,13 +69,11 @@ SOURCES += [
|
||||
'/intl/icu/source/common/ubidi.cpp',
|
||||
'/intl/icu/source/common/ubidi_props.cpp',
|
||||
'/intl/icu/source/common/ubidiln.cpp',
|
||||
'/intl/icu/source/common/ubiditransform.cpp',
|
||||
'/intl/icu/source/common/ubidiwrt.cpp',
|
||||
'/intl/icu/source/common/ubrk.cpp',
|
||||
'/intl/icu/source/common/ucase.cpp',
|
||||
'/intl/icu/source/common/ucasemap.cpp',
|
||||
'/intl/icu/source/common/ucasemap_titlecase_brkiter.cpp',
|
||||
'/intl/icu/source/common/ucat.cpp',
|
||||
'/intl/icu/source/common/uchar.cpp',
|
||||
'/intl/icu/source/common/ucharstrie.cpp',
|
||||
'/intl/icu/source/common/ucharstriebuilder.cpp',
|
||||
@@ -92,28 +82,18 @@ SOURCES += [
|
||||
'/intl/icu/source/common/ucln_cmn.cpp',
|
||||
'/intl/icu/source/common/ucmndata.cpp',
|
||||
'/intl/icu/source/common/ucnv.cpp',
|
||||
'/intl/icu/source/common/ucnv2022.cpp',
|
||||
'/intl/icu/source/common/ucnv_bld.cpp',
|
||||
'/intl/icu/source/common/ucnv_cb.cpp',
|
||||
'/intl/icu/source/common/ucnv_cnv.cpp',
|
||||
'/intl/icu/source/common/ucnv_ct.cpp',
|
||||
'/intl/icu/source/common/ucnv_err.cpp',
|
||||
'/intl/icu/source/common/ucnv_ext.cpp',
|
||||
'/intl/icu/source/common/ucnv_io.cpp',
|
||||
'/intl/icu/source/common/ucnv_lmb.cpp',
|
||||
'/intl/icu/source/common/ucnv_set.cpp',
|
||||
'/intl/icu/source/common/ucnv_u16.cpp',
|
||||
'/intl/icu/source/common/ucnv_u32.cpp',
|
||||
'/intl/icu/source/common/ucnv_u7.cpp',
|
||||
'/intl/icu/source/common/ucnv_u8.cpp',
|
||||
'/intl/icu/source/common/ucnvbocu.cpp',
|
||||
'/intl/icu/source/common/ucnvdisp.cpp',
|
||||
'/intl/icu/source/common/ucnvhz.cpp',
|
||||
'/intl/icu/source/common/ucnvisci.cpp',
|
||||
'/intl/icu/source/common/ucnvlat1.cpp',
|
||||
'/intl/icu/source/common/ucnvmbcs.cpp',
|
||||
'/intl/icu/source/common/ucnvscsu.cpp',
|
||||
'/intl/icu/source/common/ucnvsel.cpp',
|
||||
'/intl/icu/source/common/ucol_swp.cpp',
|
||||
'/intl/icu/source/common/ucptrie.cpp',
|
||||
'/intl/icu/source/common/ucurr.cpp',
|
||||
@@ -123,7 +103,6 @@ SOURCES += [
|
||||
'/intl/icu/source/common/uenum.cpp',
|
||||
'/intl/icu/source/common/uhash.cpp',
|
||||
'/intl/icu/source/common/uhash_us.cpp',
|
||||
'/intl/icu/source/common/uidna.cpp',
|
||||
'/intl/icu/source/common/uinit.cpp',
|
||||
'/intl/icu/source/common/uinvchar.cpp',
|
||||
'/intl/icu/source/common/uiter.cpp',
|
||||
@@ -149,25 +128,20 @@ SOURCES += [
|
||||
'/intl/icu/source/common/unistr_cnv.cpp',
|
||||
'/intl/icu/source/common/unistr_props.cpp',
|
||||
'/intl/icu/source/common/unistr_titlecase_brkiter.cpp',
|
||||
'/intl/icu/source/common/unorm.cpp',
|
||||
'/intl/icu/source/common/unormcmp.cpp',
|
||||
'/intl/icu/source/common/uobject.cpp',
|
||||
'/intl/icu/source/common/uprops.cpp',
|
||||
'/intl/icu/source/common/ures_cnv.cpp',
|
||||
'/intl/icu/source/common/uresbund.cpp',
|
||||
'/intl/icu/source/common/uresdata.cpp',
|
||||
'/intl/icu/source/common/usc_impl.cpp',
|
||||
'/intl/icu/source/common/uscript.cpp',
|
||||
'/intl/icu/source/common/uscript_props.cpp',
|
||||
'/intl/icu/source/common/uset.cpp',
|
||||
'/intl/icu/source/common/uset_props.cpp',
|
||||
'/intl/icu/source/common/usetiter.cpp',
|
||||
'/intl/icu/source/common/ushape.cpp',
|
||||
'/intl/icu/source/common/usprep.cpp',
|
||||
'/intl/icu/source/common/ustack.cpp',
|
||||
'/intl/icu/source/common/ustr_cnv.cpp',
|
||||
'/intl/icu/source/common/ustr_titlecase_brkiter.cpp',
|
||||
'/intl/icu/source/common/ustr_wcs.cpp',
|
||||
'/intl/icu/source/common/ustrcase.cpp',
|
||||
'/intl/icu/source/common/ustrcase_locale.cpp',
|
||||
'/intl/icu/source/common/ustrenum.cpp',
|
||||
@@ -177,7 +151,6 @@ SOURCES += [
|
||||
'/intl/icu/source/common/utext.cpp',
|
||||
'/intl/icu/source/common/utf_impl.cpp',
|
||||
'/intl/icu/source/common/util.cpp',
|
||||
'/intl/icu/source/common/util_props.cpp',
|
||||
'/intl/icu/source/common/utrace.cpp',
|
||||
'/intl/icu/source/common/utrie.cpp',
|
||||
'/intl/icu/source/common/utrie2.cpp',
|
||||
@@ -190,7 +163,35 @@ SOURCES += [
|
||||
'/intl/icu/source/common/uvectr64.cpp',
|
||||
'/intl/icu/source/common/wintz.cpp',
|
||||
]
|
||||
|
||||
other_sources = [
|
||||
'/intl/icu/source/common/bytestrieiterator.cpp',
|
||||
'/intl/icu/source/common/cstr.cpp',
|
||||
'/intl/icu/source/common/cwchar.cpp',
|
||||
'/intl/icu/source/common/icudataver.cpp',
|
||||
'/intl/icu/source/common/icuplug.cpp',
|
||||
'/intl/icu/source/common/pluralmap.cpp',
|
||||
'/intl/icu/source/common/propsvec.cpp',
|
||||
'/intl/icu/source/common/resbund_cnv.cpp',
|
||||
'/intl/icu/source/common/ubiditransform.cpp',
|
||||
'/intl/icu/source/common/ucat.cpp',
|
||||
'/intl/icu/source/common/ucnv2022.cpp',
|
||||
'/intl/icu/source/common/ucnv_ct.cpp',
|
||||
'/intl/icu/source/common/ucnv_ext.cpp',
|
||||
'/intl/icu/source/common/ucnv_lmb.cpp',
|
||||
'/intl/icu/source/common/ucnv_set.cpp',
|
||||
'/intl/icu/source/common/ucnvdisp.cpp',
|
||||
'/intl/icu/source/common/ucnvhz.cpp',
|
||||
'/intl/icu/source/common/ucnvisci.cpp',
|
||||
'/intl/icu/source/common/ucnvmbcs.cpp',
|
||||
'/intl/icu/source/common/ucnvsel.cpp',
|
||||
'/intl/icu/source/common/uidna.cpp',
|
||||
'/intl/icu/source/common/unorm.cpp',
|
||||
'/intl/icu/source/common/ures_cnv.cpp',
|
||||
'/intl/icu/source/common/usc_impl.cpp',
|
||||
'/intl/icu/source/common/ushape.cpp',
|
||||
'/intl/icu/source/common/ustr_wcs.cpp',
|
||||
'/intl/icu/source/common/util_props.cpp',
|
||||
]
|
||||
EXPORTS.unicode += [
|
||||
'/intl/icu/source/common/unicode/appendable.h',
|
||||
'/intl/icu/source/common/unicode/brkiter.h',
|
||||
|
||||
BIN
Binary file not shown.
Vendored
+14
-5
@@ -3,10 +3,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
|
||||
# Copy the pre-built ICU data file to dist/bin.
|
||||
FINAL_TARGET_FILES += [CONFIG['ICU_DATA_FILE']]
|
||||
|
||||
# Build a library containing the ICU data for use in the JS shell, so that
|
||||
# JSAPI consumers don't have to deal with setting ICU's data path.
|
||||
Library('icudata')
|
||||
@@ -17,8 +13,13 @@ if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
elif CONFIG['OS_ARCH'] == 'Darwin':
|
||||
ASFLAGS += ['-DPREFIX']
|
||||
|
||||
data_file = {
|
||||
'little': 'icudt%sl.dat' % CONFIG['MOZ_ICU_VERSION'],
|
||||
'big': 'icudt%sb.dat' % CONFIG['MOZ_ICU_VERSION'],
|
||||
}
|
||||
|
||||
ASFLAGS += [
|
||||
'-DICU_DATA_FILE="%s"' % CONFIG['ICU_DATA_FILE'],
|
||||
'-DICU_DATA_FILE="%s"' % data_file[CONFIG['TARGET_ENDIANNESS']],
|
||||
'-DICU_DATA_SYMBOL=icudt%s_dat' % CONFIG['MOZ_ICU_VERSION'],
|
||||
]
|
||||
LOCAL_INCLUDES += ['.']
|
||||
@@ -26,5 +27,13 @@ LOCAL_INCLUDES += ['.']
|
||||
if CONFIG['HAVE_YASM']:
|
||||
USE_YASM = True
|
||||
SOURCES += ['icudata.s']
|
||||
elif CONFIG['OS_ARCH'] == 'Darwin':
|
||||
if CONFIG['CPU_ARCH'] != 'ppc':
|
||||
SOURCES += ['icudata_gas.S']
|
||||
elif CONFIG['GNU_AS']:
|
||||
SOURCES += ['icudata_gas.S']
|
||||
|
||||
if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
|
||||
# Copy the pre-built ICU data file to dist/bin.
|
||||
FINAL_TARGET_FILES += [data_file[CONFIG['TARGET_ENDIANNESS']]]
|
||||
|
||||
Vendored
+3
@@ -12,3 +12,6 @@ LOCAL_INCLUDES += ['/intl/icu/source/common']
|
||||
|
||||
include('../defs.mozbuild')
|
||||
include('sources.mozbuild')
|
||||
|
||||
SOURCES += sources
|
||||
|
||||
+58
-57
@@ -1,14 +1,10 @@
|
||||
# THIS FILE IS GENERATED BY /intl/icu_sources_data.py DO NOT EDIT
|
||||
SOURCES += [
|
||||
'/intl/icu/source/i18n/alphaindex.cpp',
|
||||
'/intl/icu/source/i18n/anytrans.cpp',
|
||||
sources = [
|
||||
'/intl/icu/source/i18n/astro.cpp',
|
||||
'/intl/icu/source/i18n/basictz.cpp',
|
||||
'/intl/icu/source/i18n/bocsu.cpp',
|
||||
'/intl/icu/source/i18n/brktrans.cpp',
|
||||
'/intl/icu/source/i18n/buddhcal.cpp',
|
||||
'/intl/icu/source/i18n/calendar.cpp',
|
||||
'/intl/icu/source/i18n/casetrn.cpp',
|
||||
'/intl/icu/source/i18n/cecal.cpp',
|
||||
'/intl/icu/source/i18n/chnsecal.cpp',
|
||||
'/intl/icu/source/i18n/choicfmt.cpp',
|
||||
@@ -35,15 +31,6 @@ SOURCES += [
|
||||
'/intl/icu/source/i18n/collationweights.cpp',
|
||||
'/intl/icu/source/i18n/compactdecimalformat.cpp',
|
||||
'/intl/icu/source/i18n/coptccal.cpp',
|
||||
'/intl/icu/source/i18n/cpdtrans.cpp',
|
||||
'/intl/icu/source/i18n/csdetect.cpp',
|
||||
'/intl/icu/source/i18n/csmatch.cpp',
|
||||
'/intl/icu/source/i18n/csr2022.cpp',
|
||||
'/intl/icu/source/i18n/csrecog.cpp',
|
||||
'/intl/icu/source/i18n/csrmbcs.cpp',
|
||||
'/intl/icu/source/i18n/csrsbcs.cpp',
|
||||
'/intl/icu/source/i18n/csrucode.cpp',
|
||||
'/intl/icu/source/i18n/csrutf8.cpp',
|
||||
'/intl/icu/source/i18n/curramt.cpp',
|
||||
'/intl/icu/source/i18n/currfmt.cpp',
|
||||
'/intl/icu/source/i18n/currpinf.cpp',
|
||||
@@ -68,20 +55,15 @@ SOURCES += [
|
||||
'/intl/icu/source/i18n/dtptngen.cpp',
|
||||
'/intl/icu/source/i18n/dtrule.cpp',
|
||||
'/intl/icu/source/i18n/erarules.cpp',
|
||||
'/intl/icu/source/i18n/esctrn.cpp',
|
||||
'/intl/icu/source/i18n/ethpccal.cpp',
|
||||
'/intl/icu/source/i18n/fmtable.cpp',
|
||||
'/intl/icu/source/i18n/fmtable_cnv.cpp',
|
||||
'/intl/icu/source/i18n/format.cpp',
|
||||
'/intl/icu/source/i18n/fphdlimp.cpp',
|
||||
'/intl/icu/source/i18n/fpositer.cpp',
|
||||
'/intl/icu/source/i18n/funcrepl.cpp',
|
||||
'/intl/icu/source/i18n/gender.cpp',
|
||||
'/intl/icu/source/i18n/gregocal.cpp',
|
||||
'/intl/icu/source/i18n/gregoimp.cpp',
|
||||
'/intl/icu/source/i18n/hebrwcal.cpp',
|
||||
'/intl/icu/source/i18n/indiancal.cpp',
|
||||
'/intl/icu/source/i18n/inputext.cpp',
|
||||
'/intl/icu/source/i18n/islamcal.cpp',
|
||||
'/intl/icu/source/i18n/japancal.cpp',
|
||||
'/intl/icu/source/i18n/listformatter.cpp',
|
||||
@@ -89,13 +71,10 @@ SOURCES += [
|
||||
'/intl/icu/source/i18n/measunit.cpp',
|
||||
'/intl/icu/source/i18n/measure.cpp',
|
||||
'/intl/icu/source/i18n/msgfmt.cpp',
|
||||
'/intl/icu/source/i18n/name2uni.cpp',
|
||||
'/intl/icu/source/i18n/nfrs.cpp',
|
||||
'/intl/icu/source/i18n/nfrule.cpp',
|
||||
'/intl/icu/source/i18n/nfsubs.cpp',
|
||||
'/intl/icu/source/i18n/nortrans.cpp',
|
||||
'/intl/icu/source/i18n/nounit.cpp',
|
||||
'/intl/icu/source/i18n/nultrans.cpp',
|
||||
'/intl/icu/source/i18n/number_affixutils.cpp',
|
||||
'/intl/icu/source/i18n/number_asformat.cpp',
|
||||
'/intl/icu/source/i18n/number_capi.cpp',
|
||||
@@ -138,27 +117,13 @@ SOURCES += [
|
||||
'/intl/icu/source/i18n/persncal.cpp',
|
||||
'/intl/icu/source/i18n/plurfmt.cpp',
|
||||
'/intl/icu/source/i18n/plurrule.cpp',
|
||||
'/intl/icu/source/i18n/quant.cpp',
|
||||
'/intl/icu/source/i18n/quantityformatter.cpp',
|
||||
'/intl/icu/source/i18n/rbnf.cpp',
|
||||
'/intl/icu/source/i18n/rbt.cpp',
|
||||
'/intl/icu/source/i18n/rbt_data.cpp',
|
||||
'/intl/icu/source/i18n/rbt_pars.cpp',
|
||||
'/intl/icu/source/i18n/rbt_rule.cpp',
|
||||
'/intl/icu/source/i18n/rbt_set.cpp',
|
||||
'/intl/icu/source/i18n/rbtz.cpp',
|
||||
'/intl/icu/source/i18n/regexcmp.cpp',
|
||||
'/intl/icu/source/i18n/regeximp.cpp',
|
||||
'/intl/icu/source/i18n/regexst.cpp',
|
||||
'/intl/icu/source/i18n/regextxt.cpp',
|
||||
'/intl/icu/source/i18n/region.cpp',
|
||||
'/intl/icu/source/i18n/reldatefmt.cpp',
|
||||
'/intl/icu/source/i18n/reldtfmt.cpp',
|
||||
'/intl/icu/source/i18n/rematch.cpp',
|
||||
'/intl/icu/source/i18n/remtrans.cpp',
|
||||
'/intl/icu/source/i18n/repattrn.cpp',
|
||||
'/intl/icu/source/i18n/rulebasedcollator.cpp',
|
||||
'/intl/icu/source/i18n/scientificnumberformatter.cpp',
|
||||
'/intl/icu/source/i18n/scriptset.cpp',
|
||||
'/intl/icu/source/i18n/search.cpp',
|
||||
'/intl/icu/source/i18n/selfmt.cpp',
|
||||
@@ -168,20 +133,12 @@ SOURCES += [
|
||||
'/intl/icu/source/i18n/smpdtfst.cpp',
|
||||
'/intl/icu/source/i18n/sortkey.cpp',
|
||||
'/intl/icu/source/i18n/standardplural.cpp',
|
||||
'/intl/icu/source/i18n/strmatch.cpp',
|
||||
'/intl/icu/source/i18n/strrepl.cpp',
|
||||
'/intl/icu/source/i18n/stsearch.cpp',
|
||||
'/intl/icu/source/i18n/taiwncal.cpp',
|
||||
'/intl/icu/source/i18n/timezone.cpp',
|
||||
'/intl/icu/source/i18n/titletrn.cpp',
|
||||
'/intl/icu/source/i18n/tmunit.cpp',
|
||||
'/intl/icu/source/i18n/tmutamt.cpp',
|
||||
'/intl/icu/source/i18n/tmutfmt.cpp',
|
||||
'/intl/icu/source/i18n/tolowtrn.cpp',
|
||||
'/intl/icu/source/i18n/toupptrn.cpp',
|
||||
'/intl/icu/source/i18n/translit.cpp',
|
||||
'/intl/icu/source/i18n/transreg.cpp',
|
||||
'/intl/icu/source/i18n/tridpars.cpp',
|
||||
'/intl/icu/source/i18n/tzfmt.cpp',
|
||||
'/intl/icu/source/i18n/tzgnames.cpp',
|
||||
'/intl/icu/source/i18n/tznames.cpp',
|
||||
@@ -194,42 +151,86 @@ SOURCES += [
|
||||
'/intl/icu/source/i18n/ucol_res.cpp',
|
||||
'/intl/icu/source/i18n/ucol_sit.cpp',
|
||||
'/intl/icu/source/i18n/ucoleitr.cpp',
|
||||
'/intl/icu/source/i18n/ucsdet.cpp',
|
||||
'/intl/icu/source/i18n/udat.cpp',
|
||||
'/intl/icu/source/i18n/udateintervalformat.cpp',
|
||||
'/intl/icu/source/i18n/udatpg.cpp',
|
||||
'/intl/icu/source/i18n/ufieldpositer.cpp',
|
||||
'/intl/icu/source/i18n/uitercollationiterator.cpp',
|
||||
'/intl/icu/source/i18n/ulistformatter.cpp',
|
||||
'/intl/icu/source/i18n/ulocdata.cpp',
|
||||
'/intl/icu/source/i18n/umsg.cpp',
|
||||
'/intl/icu/source/i18n/unesctrn.cpp',
|
||||
'/intl/icu/source/i18n/uni2name.cpp',
|
||||
'/intl/icu/source/i18n/unum.cpp',
|
||||
'/intl/icu/source/i18n/unumsys.cpp',
|
||||
'/intl/icu/source/i18n/upluralrules.cpp',
|
||||
'/intl/icu/source/i18n/uregex.cpp',
|
||||
'/intl/icu/source/i18n/uregexc.cpp',
|
||||
'/intl/icu/source/i18n/uregion.cpp',
|
||||
'/intl/icu/source/i18n/usearch.cpp',
|
||||
'/intl/icu/source/i18n/uspoof.cpp',
|
||||
'/intl/icu/source/i18n/uspoof_build.cpp',
|
||||
'/intl/icu/source/i18n/uspoof_conf.cpp',
|
||||
'/intl/icu/source/i18n/uspoof_impl.cpp',
|
||||
'/intl/icu/source/i18n/utf16collationiterator.cpp',
|
||||
'/intl/icu/source/i18n/utf8collationiterator.cpp',
|
||||
'/intl/icu/source/i18n/utmscale.cpp',
|
||||
'/intl/icu/source/i18n/utrans.cpp',
|
||||
'/intl/icu/source/i18n/vtzone.cpp',
|
||||
'/intl/icu/source/i18n/vzone.cpp',
|
||||
'/intl/icu/source/i18n/windtfmt.cpp',
|
||||
'/intl/icu/source/i18n/winnmfmt.cpp',
|
||||
'/intl/icu/source/i18n/wintzimpl.cpp',
|
||||
'/intl/icu/source/i18n/zonemeta.cpp',
|
||||
]
|
||||
other_sources = [
|
||||
'/intl/icu/source/i18n/alphaindex.cpp',
|
||||
'/intl/icu/source/i18n/anytrans.cpp',
|
||||
'/intl/icu/source/i18n/brktrans.cpp',
|
||||
'/intl/icu/source/i18n/casetrn.cpp',
|
||||
'/intl/icu/source/i18n/cpdtrans.cpp',
|
||||
'/intl/icu/source/i18n/csdetect.cpp',
|
||||
'/intl/icu/source/i18n/csmatch.cpp',
|
||||
'/intl/icu/source/i18n/csr2022.cpp',
|
||||
'/intl/icu/source/i18n/csrecog.cpp',
|
||||
'/intl/icu/source/i18n/csrmbcs.cpp',
|
||||
'/intl/icu/source/i18n/csrsbcs.cpp',
|
||||
'/intl/icu/source/i18n/csrucode.cpp',
|
||||
'/intl/icu/source/i18n/csrutf8.cpp',
|
||||
'/intl/icu/source/i18n/esctrn.cpp',
|
||||
'/intl/icu/source/i18n/fmtable_cnv.cpp',
|
||||
'/intl/icu/source/i18n/funcrepl.cpp',
|
||||
'/intl/icu/source/i18n/gender.cpp',
|
||||
'/intl/icu/source/i18n/inputext.cpp',
|
||||
'/intl/icu/source/i18n/name2uni.cpp',
|
||||
'/intl/icu/source/i18n/nortrans.cpp',
|
||||
'/intl/icu/source/i18n/nultrans.cpp',
|
||||
'/intl/icu/source/i18n/quant.cpp',
|
||||
'/intl/icu/source/i18n/rbt.cpp',
|
||||
'/intl/icu/source/i18n/rbt_data.cpp',
|
||||
'/intl/icu/source/i18n/rbt_pars.cpp',
|
||||
'/intl/icu/source/i18n/rbt_rule.cpp',
|
||||
'/intl/icu/source/i18n/rbt_set.cpp',
|
||||
'/intl/icu/source/i18n/regexcmp.cpp',
|
||||
'/intl/icu/source/i18n/regeximp.cpp',
|
||||
'/intl/icu/source/i18n/regexst.cpp',
|
||||
'/intl/icu/source/i18n/regextxt.cpp',
|
||||
'/intl/icu/source/i18n/rematch.cpp',
|
||||
'/intl/icu/source/i18n/remtrans.cpp',
|
||||
'/intl/icu/source/i18n/repattrn.cpp',
|
||||
'/intl/icu/source/i18n/scientificnumberformatter.cpp',
|
||||
'/intl/icu/source/i18n/strmatch.cpp',
|
||||
'/intl/icu/source/i18n/strrepl.cpp',
|
||||
'/intl/icu/source/i18n/titletrn.cpp',
|
||||
'/intl/icu/source/i18n/tolowtrn.cpp',
|
||||
'/intl/icu/source/i18n/toupptrn.cpp',
|
||||
'/intl/icu/source/i18n/translit.cpp',
|
||||
'/intl/icu/source/i18n/transreg.cpp',
|
||||
'/intl/icu/source/i18n/tridpars.cpp',
|
||||
'/intl/icu/source/i18n/ucsdet.cpp',
|
||||
'/intl/icu/source/i18n/udateintervalformat.cpp',
|
||||
'/intl/icu/source/i18n/ulocdata.cpp',
|
||||
'/intl/icu/source/i18n/unesctrn.cpp',
|
||||
'/intl/icu/source/i18n/uni2name.cpp',
|
||||
'/intl/icu/source/i18n/uregex.cpp',
|
||||
'/intl/icu/source/i18n/uregexc.cpp',
|
||||
'/intl/icu/source/i18n/uregion.cpp',
|
||||
'/intl/icu/source/i18n/uspoof_build.cpp',
|
||||
'/intl/icu/source/i18n/uspoof_conf.cpp',
|
||||
'/intl/icu/source/i18n/utrans.cpp',
|
||||
'/intl/icu/source/i18n/vzone.cpp',
|
||||
'/intl/icu/source/i18n/zrule.cpp',
|
||||
'/intl/icu/source/i18n/ztrans.cpp',
|
||||
]
|
||||
|
||||
EXPORTS.unicode += [
|
||||
'/intl/icu/source/i18n/unicode/alphaindex.h',
|
||||
'/intl/icu/source/i18n/unicode/basictz.h',
|
||||
|
||||
Vendored
+2
-2
@@ -46,7 +46,7 @@ elif CONFIG['OS_TARGET'] == 'Darwin':
|
||||
)
|
||||
SOURCES += [
|
||||
'/nsprpub/pr/src/md/unix/darwin.c',
|
||||
'/nsprpub/pr/src/md/unix/os_Darwin.s',
|
||||
'/nsprpub/pr/src/md/unix/os_Darwin.S',
|
||||
]
|
||||
if not CONFIG['MOZ_IOS']:
|
||||
DEFINES['HAVE_CRT_EXTERNS_H'] = True
|
||||
@@ -85,7 +85,7 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
|
||||
else:
|
||||
DEFINES['_X86_'] = True
|
||||
else:
|
||||
error('Not a supported OS_TARGET for NSPR in moz.build: "%s". Use --with-system-nspr' % CONFIG['OS_TARGET'])
|
||||
error('Not a supported OS_TARGET for NSPR in moz.build: "%s". Cannot build.' % CONFIG['OS_TARGET'])
|
||||
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
# Referenced by milestone.py.
|
||||
#--------------------------------------------------------
|
||||
|
||||
6.5.0
|
||||
6.6.0
|
||||
@@ -155,8 +155,10 @@ endif
|
||||
# Interdependencies that moz.build world don't know about yet for compilation.
|
||||
# Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
|
||||
ifdef MOZ_ENABLE_NPAPI
|
||||
toolkit/library/target: widget/gtk/mozgtk/gtk3/target
|
||||
endif
|
||||
endif
|
||||
ifdef MOZ_LDAP_XPCOM
|
||||
ldap/target: security/target mozglue/build/target
|
||||
toolkit/library/target: ldap/target
|
||||
|
||||
+4
-6
@@ -411,6 +411,10 @@ EXTRA_DSO_LDOPTS += -Wl,--version-script,$(SYMBOLS_FILE)
|
||||
else
|
||||
ifeq ($(OS_TARGET),Darwin)
|
||||
EXTRA_DSO_LDOPTS += -Wl,-exported_symbols_list,$(SYMBOLS_FILE)
|
||||
else
|
||||
ifeq ($(OS_TARGET),SunOS)
|
||||
EXTRA_DSO_LDOPTS += -Wl,-M,$(SYMBOLS_FILE)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -667,9 +671,6 @@ else
|
||||
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
endif # HOST_CPP_PROG_LINK
|
||||
endif
|
||||
ifndef CROSS_COMPILE
|
||||
$(call CHECK_STDCXX,$@)
|
||||
endif
|
||||
|
||||
#
|
||||
# This is an attempt to support generation of multiple binaries
|
||||
@@ -712,9 +713,6 @@ else
|
||||
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
||||
endif
|
||||
endif
|
||||
ifndef CROSS_COMPILE
|
||||
$(call CHECK_STDCXX,$@)
|
||||
endif
|
||||
|
||||
ifdef DTRACE_PROBE_OBJ
|
||||
EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB |
@@ -1,94 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
window {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#doorhanger-container {
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
#top-panel {
|
||||
padding: 20px;
|
||||
background: #343c45; /* toolbars */
|
||||
color: #8fa1b2; /* body text */
|
||||
/*
|
||||
* Sloppy preprocessing since UNIX_BUT_NOT_MAC is only defined
|
||||
* in `browser/app/profile/firefox.js`, which this file cannot
|
||||
* depend on. Must style font-size to target linux.
|
||||
*/
|
||||
%ifdef XP_UNIX
|
||||
%ifndef XP_MACOSX
|
||||
font-size: 13px;
|
||||
%else
|
||||
font-size: 15px;
|
||||
%endif
|
||||
%else
|
||||
font-size: 15px;
|
||||
%endif
|
||||
line-height: 19px;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
#top-panel h1 {
|
||||
font-weight: bold;
|
||||
font-family: Open Sans, sans-serif;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
#top-panel p {
|
||||
font-family: Open Sans, sans-serif;
|
||||
font-size: 0.9em;
|
||||
width: 300px;
|
||||
display: block;
|
||||
margin: 5px 0px 0px 0px;
|
||||
}
|
||||
|
||||
#icon {
|
||||
background-image: url("chrome://devtools/content/framework/dev-edition-promo/dev-edition-logo.png");
|
||||
background-size: 64px 64px;
|
||||
background-repeat: no-repeat;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#lower-panel {
|
||||
padding: 20px;
|
||||
background-color: #252c33; /* tab toolbars */
|
||||
min-height: 75px;
|
||||
border-top: 1px solid #292e33; /* text high contrast (light) */
|
||||
}
|
||||
|
||||
#button-container {
|
||||
margin: auto 20px;
|
||||
}
|
||||
|
||||
#button-container button {
|
||||
font: message-box !important;
|
||||
font-size: 16px !important;
|
||||
cursor: pointer;
|
||||
width: 125px;
|
||||
opacity: 1;
|
||||
position: static;
|
||||
-moz-appearance: none;
|
||||
border-radius: 5px;
|
||||
height: 30px;
|
||||
width: 450px;
|
||||
/* Override embossed borders on Windows/Linux */
|
||||
border: none;
|
||||
}
|
||||
|
||||
#close {
|
||||
background-color: transparent;
|
||||
color: #8fa1b2; /* body text */
|
||||
}
|
||||
|
||||
#go {
|
||||
margin-left: 100px;
|
||||
background-color: #70bf53; /* green */
|
||||
color: #f5f7fa; /* selection text color */
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % toolboxDTD SYSTEM "chrome://devtools/locale/toolbox.dtd" >
|
||||
%toolboxDTD;
|
||||
]>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet rel="stylesheet" href="chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.css" type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="dev-edition-promo">
|
||||
<vbox id="doorhanger-container">
|
||||
<hbox flex="1" id="top-panel">
|
||||
<image id="icon" />
|
||||
<vbox id="info">
|
||||
<h1>Using Developer Tools in your browser?</h1>
|
||||
<p>Download Firefox Developer Edition, our first browser made just for you.</p>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<hbox id="lower-panel" flex="1">
|
||||
<hbox id="button-container" flex="1">
|
||||
<button id="close"
|
||||
flex="1"
|
||||
standalone="true"
|
||||
label="No thanks">
|
||||
</button>
|
||||
<button id="go"
|
||||
flex="1"
|
||||
standalone="true"
|
||||
label="Learn more »">
|
||||
</button>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
||||
@@ -46,8 +46,6 @@ loader.lazyRequireGetter(this, "InspectorFront",
|
||||
"devtools/shared/fronts/inspector", true);
|
||||
loader.lazyRequireGetter(this, "flags",
|
||||
"devtools/shared/flags");
|
||||
loader.lazyRequireGetter(this, "showDoorhanger",
|
||||
"devtools/client/shared/doorhanger", true);
|
||||
loader.lazyRequireGetter(this, "createPerformanceFront",
|
||||
"devtools/shared/fronts/performance", true);
|
||||
loader.lazyRequireGetter(this, "system",
|
||||
@@ -117,7 +115,6 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
|
||||
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
|
||||
this._onFocus = this._onFocus.bind(this);
|
||||
this._onBrowserMessage = this._onBrowserMessage.bind(this);
|
||||
this._showDevEditionPromo = this._showDevEditionPromo.bind(this);
|
||||
this._updateTextBoxMenuItems = this._updateTextBoxMenuItems.bind(this);
|
||||
this._onBottomHostMinimized = this._onBottomHostMinimized.bind(this);
|
||||
this._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
|
||||
@@ -149,8 +146,6 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
|
||||
this.on("host-changed", this._refreshHostTitle);
|
||||
this.on("select", this._refreshHostTitle);
|
||||
|
||||
this.on("ready", this._showDevEditionPromo);
|
||||
|
||||
gDevTools.on("tool-registered", this._toolRegistered);
|
||||
gDevTools.on("tool-unregistered", this._toolUnregistered);
|
||||
|
||||
@@ -2095,7 +2090,6 @@ Toolbox.prototype = {
|
||||
this._target.off("frame-update", this._updateFrames);
|
||||
this.off("select", this._refreshHostTitle);
|
||||
this.off("host-changed", this._refreshHostTitle);
|
||||
this.off("ready", this._showDevEditionPromo);
|
||||
|
||||
gDevTools.off("tool-registered", this._toolRegistered);
|
||||
gDevTools.off("tool-unregistered", this._toolUnregistered);
|
||||
@@ -2188,14 +2182,16 @@ Toolbox.prototype = {
|
||||
.then(() => {
|
||||
this._removeHostListeners();
|
||||
|
||||
// `location` may already be null if the toolbox document is already
|
||||
// in process of destruction. Otherwise if it is still around, ensure
|
||||
// releasing toolbox document and triggering cleanup thanks to unload
|
||||
// event. We do that precisely here, before nullifying the target as
|
||||
// various cleanup code depends on the target attribute to be still
|
||||
// defined.
|
||||
if (win.location) {
|
||||
// `location` may already be invalid if the toolbox document is
|
||||
// already in process of destruction. Otherwise if it is still
|
||||
// around, ensure releasing toolbox document and triggering cleanup
|
||||
// thanks to unload event. We do that precisely here, before
|
||||
// nullifying the target as various cleanup code depends on the
|
||||
// target attribute to be still defined.
|
||||
try {
|
||||
win.location.replace("about:blank");
|
||||
} catch (e) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
// Targets need to be notified that the toolbox is being torn down.
|
||||
@@ -2251,18 +2247,6 @@ Toolbox.prototype = {
|
||||
this.emit("highlighter-hide");
|
||||
},
|
||||
|
||||
/**
|
||||
* For displaying the promotional Doorhanger on first opening of
|
||||
* the developer tools, promoting the Developer Edition.
|
||||
*/
|
||||
_showDevEditionPromo: function () {
|
||||
// Do not display in browser toolbox
|
||||
if (this.target.chrome) {
|
||||
return;
|
||||
}
|
||||
showDoorhanger({ window: this.win, type: "deveditionpromo" });
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable / disable necessary textbox menu items using globalOverlay.js.
|
||||
*/
|
||||
|
||||
@@ -111,9 +111,6 @@ devtools.jar:
|
||||
content/framework/options-panel.css (framework/options-panel.css)
|
||||
content/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul)
|
||||
* content/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
|
||||
content/framework/dev-edition-promo/dev-edition-promo.xul (framework/dev-edition-promo/dev-edition-promo.xul)
|
||||
* content/framework/dev-edition-promo/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css)
|
||||
content/framework/dev-edition-promo/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)
|
||||
content/inspector/inspector.xhtml (inspector/inspector.xhtml)
|
||||
content/framework/connect/connect.xhtml (framework/connect/connect.xhtml)
|
||||
content/framework/connect/connect.css (framework/connect/connect.css)
|
||||
|
||||
@@ -39,9 +39,8 @@ function ConverterObserver() {
|
||||
|
||||
ConverterObserver.prototype = {
|
||||
initialize: function () {
|
||||
// Only the DevEdition has this feature available by default.
|
||||
// Users need to manually flip 'devtools.jsonview.enabled' preference
|
||||
// to have it available in other distributions.
|
||||
// to have it available.
|
||||
if (this.isEnabled()) {
|
||||
this.register();
|
||||
}
|
||||
|
||||
@@ -3,17 +3,6 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Developer edition promo preferences
|
||||
pref("devtools.devedition.promo.shown", false);
|
||||
pref("devtools.devedition.promo.url", "https://www.mozilla.org/firefox/developer/?utm_source=firefox-dev-tools&utm_medium=firefox-browser&utm_content=betadoorhanger");
|
||||
|
||||
// Only potentially show in beta release
|
||||
#if MOZ_UPDATE_CHANNEL == beta
|
||||
pref("devtools.devedition.promo.enabled", true);
|
||||
#else
|
||||
pref("devtools.devedition.promo.enabled", false);
|
||||
#endif
|
||||
|
||||
// DevTools development workflow
|
||||
pref("devtools.loader.hotreload", false);
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ const Cu = Components.utils;
|
||||
|
||||
var {loader, require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var Telemetry = require("devtools/client/shared/telemetry");
|
||||
var {showDoorhanger} = require("devtools/client/shared/doorhanger");
|
||||
var {TouchEventSimulator} = require("devtools/shared/touch/simulator");
|
||||
var {Task} = require("devtools/shared/task");
|
||||
var promise = require("promise");
|
||||
@@ -255,14 +254,6 @@ ResponsiveUI.prototype = {
|
||||
yield this.connectToServer();
|
||||
this.userAgentInput.hidden = false;
|
||||
|
||||
// Hook to display promotional Developer Edition doorhanger.
|
||||
// Only displayed once.
|
||||
showDoorhanger({
|
||||
window: this.mainWindow,
|
||||
type: "deveditionpromo",
|
||||
anchor: this.chromeDoc.querySelector("#content")
|
||||
});
|
||||
|
||||
// Notify that responsive mode is on.
|
||||
this._telemetry.toolOpened("responsive");
|
||||
ResponsiveUIManager.emit("on", { tab: this.tab });
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { Ci, Cc } = require("chrome");
|
||||
const Services = require("Services");
|
||||
const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const defer = require("devtools/shared/defer");
|
||||
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
|
||||
|
||||
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
const DEV_EDITION_PROMO_URL = "chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.xul";
|
||||
const DEV_EDITION_PROMO_ENABLED_PREF = "devtools.devedition.promo.enabled";
|
||||
const DEV_EDITION_PROMO_SHOWN_PREF = "devtools.devedition.promo.shown";
|
||||
const DEV_EDITION_PROMO_URL_PREF = "devtools.devedition.promo.url";
|
||||
const LOCALE = Cc["@mozilla.org/chrome/chrome-registry;1"]
|
||||
.getService(Ci.nsIXULChromeRegistry)
|
||||
.getSelectedLocale("global");
|
||||
|
||||
/**
|
||||
* Only show Dev Edition promo if it's enabled (beta channel),
|
||||
* if it has not been shown before, and it's a locale build
|
||||
* for `en-US`
|
||||
*/
|
||||
function shouldDevEditionPromoShow() {
|
||||
return Services.prefs.getBoolPref(DEV_EDITION_PROMO_ENABLED_PREF) &&
|
||||
!Services.prefs.getBoolPref(DEV_EDITION_PROMO_SHOWN_PREF) &&
|
||||
LOCALE === "en-US";
|
||||
}
|
||||
|
||||
var TYPES = {
|
||||
// The Developer Edition promo doorhanger, called by
|
||||
// opening the toolbox, browser console, WebIDE, or responsive design mode
|
||||
// in Beta releases. Only displayed once per profile.
|
||||
deveditionpromo: {
|
||||
predicate: shouldDevEditionPromoShow,
|
||||
success: () => {
|
||||
return Services.prefs.setBoolPref(DEV_EDITION_PROMO_SHOWN_PREF, true);
|
||||
},
|
||||
action: () => {
|
||||
let url = Services.prefs.getCharPref(DEV_EDITION_PROMO_URL_PREF);
|
||||
getGBrowser().selectedTab = getGBrowser().addTab(url);
|
||||
},
|
||||
url: DEV_EDITION_PROMO_URL
|
||||
}
|
||||
};
|
||||
|
||||
var panelAttrs = {
|
||||
orient: "vertical",
|
||||
hidden: "false",
|
||||
consumeoutsideclicks: "true",
|
||||
noautofocus: "true",
|
||||
align: "start",
|
||||
role: "alert"
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper to call a doorhanger, defined in `TYPES`, with defined conditions,
|
||||
* success handlers and loads its own XUL in a frame. Takes an object with
|
||||
* several properties:
|
||||
*
|
||||
* @param {XULWindow} window
|
||||
* The window that should house the doorhanger.
|
||||
* @param {String} type
|
||||
* The type of doorhanger to be displayed is, using the `TYPES`
|
||||
* definition.
|
||||
* @param {String} selector
|
||||
* The selector that the doorhanger should be appended to within
|
||||
* `window`. Defaults to a XUL Document's `window` element.
|
||||
*/
|
||||
exports.showDoorhanger = Task.async(function* ({ window, type, anchor }) {
|
||||
let { predicate, success, url, action } = TYPES[type];
|
||||
// Abort if predicate fails
|
||||
if (!predicate()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Call success function to set preferences/cleanup immediately,
|
||||
// so if triggered multiple times, only happens once (Windows/Linux)
|
||||
success();
|
||||
|
||||
// Wait 200ms to prevent flickering where the popup is displayed
|
||||
// before the underlying window (Windows 7, 64bit)
|
||||
yield wait(200);
|
||||
|
||||
let document = window.document;
|
||||
|
||||
let panel = document.createElementNS(XULNS, "panel");
|
||||
let frame = document.createElementNS(XULNS, "iframe");
|
||||
let parentEl = document.querySelector("window");
|
||||
|
||||
frame.setAttribute("src", url);
|
||||
let close = () => parentEl.removeChild(panel);
|
||||
|
||||
setDoorhangerStyle(panel, frame);
|
||||
|
||||
panel.appendChild(frame);
|
||||
parentEl.appendChild(panel);
|
||||
|
||||
yield onFrameLoad(frame);
|
||||
|
||||
panel.openPopup(anchor);
|
||||
|
||||
let closeBtn = frame.contentDocument.querySelector("#close");
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener("click", close);
|
||||
}
|
||||
|
||||
let goBtn = frame.contentDocument.querySelector("#go");
|
||||
if (goBtn) {
|
||||
goBtn.addEventListener("click", () => {
|
||||
if (action) {
|
||||
action();
|
||||
}
|
||||
close();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function setDoorhangerStyle(panel, frame) {
|
||||
Object.keys(panelAttrs).forEach(prop => {
|
||||
return panel.setAttribute(prop, panelAttrs[prop]);
|
||||
});
|
||||
panel.style.margin = "20px";
|
||||
panel.style.borderRadius = "5px";
|
||||
panel.style.border = "none";
|
||||
panel.style.MozAppearance = "none";
|
||||
panel.style.backgroundColor = "transparent";
|
||||
|
||||
frame.style.borderRadius = "5px";
|
||||
frame.setAttribute("flex", "1");
|
||||
frame.setAttribute("width", "450");
|
||||
frame.setAttribute("height", "179");
|
||||
}
|
||||
|
||||
function onFrameLoad(frame) {
|
||||
let { resolve, promise } = defer();
|
||||
|
||||
if (frame.contentWindow) {
|
||||
let domHelper = new DOMHelpers(frame.contentWindow);
|
||||
domHelper.onceDOMReady(resolve);
|
||||
} else {
|
||||
let callback = () => {
|
||||
frame.removeEventListener("DOMContentLoaded", callback);
|
||||
resolve();
|
||||
};
|
||||
frame.addEventListener("DOMContentLoaded", callback);
|
||||
}
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
function getGBrowser() {
|
||||
return getMostRecentBrowserWindow().gBrowser;
|
||||
}
|
||||
|
||||
function wait(n) {
|
||||
let { resolve, promise } = defer();
|
||||
setTimeout(resolve, n);
|
||||
return promise;
|
||||
}
|
||||
@@ -26,7 +26,6 @@ DevToolsModules(
|
||||
'devices.js',
|
||||
'devtools-file-watcher.js',
|
||||
'DOMHelpers.jsm',
|
||||
'doorhanger.js',
|
||||
'file-watcher-worker.js',
|
||||
'file-watcher.js',
|
||||
'getjson.js',
|
||||
|
||||
@@ -908,6 +908,10 @@ VariablesView.prototype = {
|
||||
// Copy current selection to clipboard.
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
let item = this.getFocusedItem();
|
||||
if (!item) {
|
||||
// No item is selected; do nothing.
|
||||
return;
|
||||
}
|
||||
clipboardHelper.copyString(
|
||||
item._nameString + item.separatorStr + item._valueString
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@ loader.lazyRequireGetter(this, "WebConsoleFrame", "devtools/client/webconsole/we
|
||||
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
|
||||
loader.lazyRequireGetter(this, "showDoorhanger", "devtools/client/shared/doorhanger", true);
|
||||
loader.lazyRequireGetter(this, "viewSource", "devtools/client/shared/view-source");
|
||||
|
||||
const STRINGS_URI = "devtools/client/locales/webconsole.properties";
|
||||
@@ -675,19 +674,12 @@ BrowserConsole.prototype = extend(WebConsole.prototype, {
|
||||
// instance.
|
||||
let onClose = () => {
|
||||
window.removeEventListener("unload", onClose);
|
||||
window.removeEventListener("focus", onFocus);
|
||||
this.destroy();
|
||||
};
|
||||
window.addEventListener("unload", onClose);
|
||||
|
||||
this._telemetry.toolOpened("browserconsole");
|
||||
|
||||
// Create an onFocus handler just to display the dev edition promo.
|
||||
// This is to prevent race conditions in some environments.
|
||||
// Hook to display promotional Developer Edition doorhanger. Only displayed once.
|
||||
let onFocus = () => showDoorhanger({ window, type: "deveditionpromo" });
|
||||
window.addEventListener("focus", onFocus);
|
||||
|
||||
this._bc_init = this.$init();
|
||||
return this._bc_init;
|
||||
},
|
||||
|
||||
@@ -537,6 +537,7 @@ function newChannelForURL(url, { policy, window, principal }) {
|
||||
// scheme to see if it helps.
|
||||
uri = Services.io.newURI("file://" + url, null, null);
|
||||
}
|
||||
|
||||
let channelOptions = {
|
||||
contentPolicyType: policy,
|
||||
securityFlags: securityFlags,
|
||||
@@ -557,15 +558,7 @@ function newChannelForURL(url, { policy, window, principal }) {
|
||||
}
|
||||
channelOptions.loadingPrincipal = prin;
|
||||
|
||||
try {
|
||||
return NetUtil.newChannel(channelOptions);
|
||||
} catch (e) {
|
||||
// In xpcshell tests on Windows, nsExternalProtocolHandler::NewChannel()
|
||||
// can throw NS_ERROR_UNKNOWN_PROTOCOL if the external protocol isn't
|
||||
// supported by Windows, so we also need to handle the exception here if
|
||||
// parsing the URL above doesn't throw.
|
||||
return newChannelForURL("file://" + url, { policy, window, principal });
|
||||
}
|
||||
return NetUtil.newChannel(channelOptions);
|
||||
}
|
||||
|
||||
// Fetch is defined differently depending on whether we are on the main thread
|
||||
|
||||
@@ -2208,10 +2208,10 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -2231,10 +2231,10 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -3282,7 +3282,6 @@ exports.CSS_PROPERTIES = {
|
||||
"-moz-crisp-edges",
|
||||
"-moz-deck",
|
||||
"-moz-element",
|
||||
"-moz-fit-content",
|
||||
"-moz-grid",
|
||||
"-moz-grid-group",
|
||||
"-moz-grid-line",
|
||||
@@ -3424,6 +3423,7 @@ exports.CSS_PROPERTIES = {
|
||||
"extra-expanded",
|
||||
"fill",
|
||||
"fill-box",
|
||||
"fit-content",
|
||||
"fixed",
|
||||
"flat",
|
||||
"flex",
|
||||
@@ -6000,10 +6000,10 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -6023,10 +6023,10 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -6816,9 +6816,9 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -6903,9 +6903,9 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -7257,6 +7257,25 @@ exports.CSS_PROPERTIES = {
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"margin-block": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"margin-block-start",
|
||||
"margin-block-end"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"values": [
|
||||
"-moz-calc",
|
||||
"auto",
|
||||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"margin-block-end": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
@@ -7311,6 +7330,25 @@ exports.CSS_PROPERTIES = {
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"margin-inline": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"margin-inline-start",
|
||||
"margin-inline-end"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"values": [
|
||||
"-moz-calc",
|
||||
"auto",
|
||||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"margin-inline-end": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
@@ -7744,8 +7782,8 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -7766,8 +7804,8 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -7788,8 +7826,8 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -7828,9 +7866,9 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -7850,9 +7888,9 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -7872,9 +7910,9 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -8246,6 +8284,24 @@ exports.CSS_PROPERTIES = {
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"padding-block": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"padding-block-start",
|
||||
"padding-block-end"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"values": [
|
||||
"-moz-calc",
|
||||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"padding-block-end": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
@@ -8297,6 +8353,24 @@ exports.CSS_PROPERTIES = {
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"padding-inline": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"padding-inline-start",
|
||||
"padding-inline-end"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"values": [
|
||||
"-moz-calc",
|
||||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"padding-inline-end": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
@@ -9636,9 +9710,9 @@ exports.CSS_PROPERTIES = {
|
||||
"values": [
|
||||
"-moz-available",
|
||||
"-moz-calc",
|
||||
"-moz-fit-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"fit-content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"max-content",
|
||||
@@ -9752,6 +9826,7 @@ exports.CSS_PROPERTIES = {
|
||||
exports.PSEUDO_ELEMENTS = [
|
||||
":after",
|
||||
":before",
|
||||
":slotted",
|
||||
":backdrop",
|
||||
":first-letter",
|
||||
":first-line",
|
||||
|
||||
@@ -136,7 +136,7 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType,
|
||||
mExistingJPEGRequest = baseChannel;
|
||||
}
|
||||
|
||||
if (rv == NS_ERROR_REMOTE_XUL) {
|
||||
if (rv == NS_ERROR_REMOTE_XUL || rv == NS_ERROR_DOCSHELL_DYING) {
|
||||
aRequest->Cancel(rv);
|
||||
*aAbortProcess = true;
|
||||
return NS_OK;
|
||||
|
||||
@@ -892,6 +892,8 @@ nsDocShell::~nsDocShell()
|
||||
nsresult
|
||||
nsDocShell::Init()
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
nsresult rv = nsDocLoader::Init();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
@@ -1916,6 +1918,8 @@ bool
|
||||
nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
|
||||
bool aFireOnLocationChange, uint32_t aLocationFlags)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) {
|
||||
PR_LogPrint("DOCSHELL %p SetCurrentURI %s\n",
|
||||
this, aURI ? aURI->GetSpecOrDefault().get() : "");
|
||||
@@ -2176,6 +2180,8 @@ nsDocShell::SetUsePrivateBrowsing(bool aUsePrivateBrowsing)
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetPrivateBrowsing(bool aUsePrivateBrowsing)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
bool changed = aUsePrivateBrowsing != (mPrivateBrowsingId > 0);
|
||||
if (changed) {
|
||||
mPrivateBrowsingId = aUsePrivateBrowsing ? 1 : 0;
|
||||
@@ -2246,6 +2252,8 @@ nsDocShell::SetRemoteTabs(bool aUseRemoteTabs)
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetAffectPrivateSessionLifetime(bool aAffectLifetime)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
bool change = aAffectLifetime != mAffectPrivateSessionLifetime;
|
||||
if (change && UsePrivateBrowsing()) {
|
||||
AssertOriginAttributesMatchPrivateBrowsing();
|
||||
@@ -2748,6 +2756,8 @@ nsDocShell::GetSecurityUI(nsISecureBrowserUI** aSecurityUI)
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetSecurityUI(nsISecureBrowserUI* aSecurityUI)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
mSecurityUI = aSecurityUI;
|
||||
mSecurityUI->SetDocShell(this);
|
||||
return NS_OK;
|
||||
@@ -3930,6 +3940,10 @@ PrintDocTree(nsIDocShellTreeItem* aParentNode)
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetTreeOwner(nsIDocShellTreeOwner* aTreeOwner)
|
||||
{
|
||||
if (mIsBeingDestroyed && aTreeOwner) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DOCSHELL_FOCUS
|
||||
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aTreeOwner));
|
||||
if (item) {
|
||||
@@ -5186,6 +5200,8 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
|
||||
const char* aCSSClass,
|
||||
nsIChannel* aFailedChannel)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
#if defined(DEBUG)
|
||||
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
|
||||
nsAutoCString chanName;
|
||||
@@ -5539,6 +5555,8 @@ nsDocShell::SetSessionHistory(nsISHistory* aSessionHistory)
|
||||
// make sure that we are the root docshell and
|
||||
// set a handle to root docshell in SH.
|
||||
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
/* Get the root docshell. If *this* is the root docshell
|
||||
* then save a handle to *this* in SH. SH needs it to do
|
||||
@@ -5719,16 +5737,22 @@ nsDocShell::Create()
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::Destroy()
|
||||
{
|
||||
// XXX: We allow this function to be called just once. If you are going to
|
||||
// reset new variables in this function, please make sure the variables will
|
||||
// never be re-initialized. Adding assertions to check |mIsBeingDestroyed|
|
||||
// in the setter functions for the variables would be enough.
|
||||
if (mIsBeingDestroyed) {
|
||||
return NS_ERROR_DOCSHELL_DYING;
|
||||
}
|
||||
|
||||
NS_ASSERTION(mItemType == typeContent || mItemType == typeChrome,
|
||||
"Unexpected item type in docshell");
|
||||
|
||||
if (!mIsBeingDestroyed) {
|
||||
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
|
||||
if (serv) {
|
||||
const char* msg = mItemType == typeContent ?
|
||||
NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
|
||||
serv->NotifyObservers(GetAsSupports(this), msg, nullptr);
|
||||
}
|
||||
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
|
||||
if (serv) {
|
||||
const char* msg = mItemType == typeContent ?
|
||||
NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
|
||||
serv->NotifyObservers(GetAsSupports(this), msg, nullptr);
|
||||
}
|
||||
|
||||
mIsBeingDestroyed = true;
|
||||
@@ -6011,6 +6035,7 @@ nsDocShell::GetParentWidget(nsIWidget** aParentWidget)
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetParentWidget(nsIWidget* aParentWidget)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
mParentWidget = aParentWidget;
|
||||
|
||||
return NS_OK;
|
||||
@@ -6281,6 +6306,8 @@ nsDocShell::SetOnePermittedSandboxedNavigator(nsIDocShell* aSandboxedNavigator)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
mOnePermittedSandboxedNavigator = do_GetWeakReference(aSandboxedNavigator);
|
||||
NS_ASSERTION(mOnePermittedSandboxedNavigator,
|
||||
"One Permitted Sandboxed Navigator must support weak references.");
|
||||
@@ -6641,6 +6668,8 @@ nsDocShell::RefreshURI(nsIURI* aURI,
|
||||
bool aMetaRefresh,
|
||||
nsIPrincipal* aPrincipal)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
NS_ENSURE_ARG(aURI);
|
||||
|
||||
/* Check if Meta refresh/redirects are permitted. Some
|
||||
@@ -7985,6 +8014,10 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
|
||||
// wrong information :-(
|
||||
//
|
||||
(void)FirePageHideNotification(!mSavingOldViewer);
|
||||
// pagehide notification might destroy this docshell.
|
||||
if (mIsBeingDestroyed) {
|
||||
return NS_ERROR_DOCSHELL_DYING;
|
||||
}
|
||||
}
|
||||
|
||||
// Now make sure we don't think we're in the middle of firing unload after
|
||||
@@ -8128,6 +8161,8 @@ nsDocShell::CanSavePresentation(uint32_t aLoadType,
|
||||
void
|
||||
nsDocShell::ReattachEditorToWindow(nsISHEntry* aSHEntry)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
NS_ASSERTION(!mEditorData,
|
||||
"Why reattach an editor when we already have one?");
|
||||
NS_ASSERTION(aSHEntry && aSHEntry->HasDetachedEditor(),
|
||||
@@ -8165,6 +8200,9 @@ nsDocShell::DetachEditorFromWindow()
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Make mOSHE hold the owning ref to the editor data.
|
||||
if (mOSHE) {
|
||||
MOZ_ASSERT(!mIsBeingDestroyed || !mOSHE->HasDetachedEditor(),
|
||||
"We should not set the editor data again once after we "
|
||||
"detached the editor data during destroying this docshell");
|
||||
mOSHE->SetEditorData(mEditorData.forget());
|
||||
} else {
|
||||
mEditorData = nullptr;
|
||||
@@ -8351,6 +8389,8 @@ nsDocShell::GetRestoringDocument(bool* aRestoring)
|
||||
nsresult
|
||||
nsDocShell::RestorePresentation(nsISHEntry* aSHEntry, bool* aRestoring)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
NS_ASSERTION(mLoadType & LOAD_CMD_HISTORY,
|
||||
"RestorePresentation should only be called for history loads");
|
||||
|
||||
@@ -8512,6 +8552,10 @@ nsDocShell::RestoreFromHistory()
|
||||
|
||||
// Notify the old content viewer that it's being hidden.
|
||||
FirePageHideNotification(!mSavingOldViewer);
|
||||
// pagehide notification might destroy this docshell.
|
||||
if (mIsBeingDestroyed) {
|
||||
return NS_ERROR_DOCSHELL_DYING;
|
||||
}
|
||||
|
||||
// If mLSHE was changed as a result of the pagehide event, then
|
||||
// something else was loaded. Don't finish restoring.
|
||||
@@ -8969,6 +9013,12 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
|
||||
{
|
||||
*aContentHandler = nullptr;
|
||||
|
||||
if (!mTreeOwner || mIsBeingDestroyed) {
|
||||
// If we don't have a tree owner, then we're in the process of being
|
||||
// destroyed. Rather than continue trying to load something, just give up.
|
||||
return NS_ERROR_DOCSHELL_DYING;
|
||||
}
|
||||
|
||||
// Can we check the content type of the current content viewer
|
||||
// and reuse it without destroying it and re-creating it?
|
||||
|
||||
@@ -9008,6 +9058,11 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
|
||||
aOpenedChannel->GetURI(getter_AddRefs(mLoadingURI));
|
||||
}
|
||||
FirePageHideNotification(!mSavingOldViewer);
|
||||
if (mIsBeingDestroyed) {
|
||||
// Force to stop the newly created orphaned viewer.
|
||||
viewer->Stop();
|
||||
return NS_ERROR_DOCSHELL_DYING;
|
||||
}
|
||||
mLoadingURI = nullptr;
|
||||
|
||||
// Set mFiredUnloadEvent = false so that the unload handler for the
|
||||
@@ -9197,6 +9252,8 @@ nsDocShell::NewContentViewerObj(const nsACString& aContentType,
|
||||
nsresult
|
||||
nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
//
|
||||
// Copy content viewer state from previous or parent content viewer.
|
||||
//
|
||||
@@ -13382,6 +13439,8 @@ nsDocShell::EnsureScriptEnvironment()
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::EnsureEditorData()
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
bool openDocHasDetachedEditor = mOSHE && mOSHE->HasDetachedEditor();
|
||||
if (!mEditorData && !mIsBeingDestroyed && !openDocHasDetachedEditor) {
|
||||
// We shouldn't recreate the editor data if it already exists, or
|
||||
@@ -13397,6 +13456,8 @@ nsDocShell::EnsureEditorData()
|
||||
nsresult
|
||||
nsDocShell::EnsureTransferableHookData()
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
if (!mTransferableHookData) {
|
||||
mTransferableHookData = new nsTransferableHookData();
|
||||
}
|
||||
@@ -14469,6 +14530,8 @@ nsDocShell::CanSetOriginAttributes()
|
||||
nsresult
|
||||
nsDocShell::SetOriginAttributes(const DocShellOriginAttributes& aAttrs)
|
||||
{
|
||||
MOZ_ASSERT(!mIsBeingDestroyed);
|
||||
|
||||
if (!CanSetOriginAttributes()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1383,6 +1383,30 @@ Animation::GetRenderedDocument() const
|
||||
return mEffect->AsKeyframeEffect()->GetRenderedDocument();
|
||||
}
|
||||
|
||||
class AsyncFinishNotification : public MicroTaskRunnable
|
||||
{
|
||||
public:
|
||||
explicit AsyncFinishNotification(Animation* aAnimation)
|
||||
: MicroTaskRunnable()
|
||||
, mAnimation(aAnimation)
|
||||
{}
|
||||
|
||||
virtual void Run(AutoSlowOperation& aAso) override
|
||||
{
|
||||
mAnimation->DoFinishNotificationImmediately(this);
|
||||
mAnimation = nullptr;
|
||||
}
|
||||
|
||||
virtual bool Suppressed() override
|
||||
{
|
||||
nsIGlobalObject* global = mAnimation->GetOwnerGlobal();
|
||||
return global && global->IsInSyncOperation();
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<Animation> mAnimation;
|
||||
};
|
||||
|
||||
void
|
||||
Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
|
||||
{
|
||||
@@ -1390,9 +1414,8 @@ Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
|
||||
|
||||
if (aSyncNotifyFlag == SyncNotifyFlag::Sync) {
|
||||
DoFinishNotificationImmediately();
|
||||
} else if (!mFinishNotificationTask.IsPending()) {
|
||||
RefPtr<nsRunnableMethod<Animation>> runnable =
|
||||
NewRunnableMethod(this, &Animation::DoFinishNotificationImmediately);
|
||||
} else if (!mFinishNotificationTask) {
|
||||
RefPtr<MicroTaskRunnable> runnable = new AsyncFinishNotification(this);
|
||||
context->DispatchToMicroTask(do_AddRef(runnable));
|
||||
mFinishNotificationTask = runnable.forget();
|
||||
}
|
||||
@@ -1415,9 +1438,13 @@ Animation::MaybeResolveFinishedPromise()
|
||||
}
|
||||
|
||||
void
|
||||
Animation::DoFinishNotificationImmediately()
|
||||
Animation::DoFinishNotificationImmediately(MicroTaskRunnable* aAsync)
|
||||
{
|
||||
mFinishNotificationTask.Revoke();
|
||||
if (aAsync && aAsync != mFinishNotificationTask) {
|
||||
return;
|
||||
}
|
||||
|
||||
mFinishNotificationTask = nullptr;
|
||||
|
||||
if (PlayState() != AnimationPlayState::Finished) {
|
||||
return;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/CycleCollectedJSContext.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
#include "mozilla/EffectCompositor.h" // For EffectCompositor::CascadeLevel
|
||||
#include "mozilla/LinkedList.h"
|
||||
@@ -42,6 +43,7 @@ class AnimValuesStyleRule;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class AsyncFinishNotification;
|
||||
class CSSAnimation;
|
||||
class CSSTransition;
|
||||
|
||||
@@ -378,7 +380,8 @@ protected:
|
||||
void ResetFinishedPromise();
|
||||
void MaybeResolveFinishedPromise();
|
||||
void DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag);
|
||||
void DoFinishNotificationImmediately();
|
||||
friend class AsyncFinishNotification;
|
||||
void DoFinishNotificationImmediately(MicroTaskRunnable* aAsync = nullptr);
|
||||
void DispatchPlaybackEvent(const nsAString& aName);
|
||||
|
||||
/**
|
||||
@@ -446,7 +449,7 @@ protected:
|
||||
// getAnimations() list.
|
||||
bool mIsRelevant;
|
||||
|
||||
nsRevocableEventPtr<nsRunnableMethod<Animation>> mFinishNotificationTask;
|
||||
RefPtr<MicroTaskRunnable> mFinishNotificationTask;
|
||||
// True if mFinished is resolved or would be resolved if mFinished has
|
||||
// yet to be created. This is not set when mFinished is rejected since
|
||||
// in that case mFinished is immediately reset to represent a new current
|
||||
|
||||
@@ -155,6 +155,13 @@ DocumentTimeline::WillRefresh(mozilla::TimeStamp aTime)
|
||||
bool needsTicks = false;
|
||||
nsTArray<Animation*> animationsToRemove(mAnimations.Count());
|
||||
|
||||
// https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events,
|
||||
// step2.
|
||||
// Note that this should be done before nsAutoAnimationMutationBatch. If
|
||||
// PerformMicroTaskCheckpoint was called before nsAutoAnimationMutationBatch
|
||||
// is destroyed, some mutation records might not be delivered in this
|
||||
// checkpoint.
|
||||
nsAutoMicroTask mt;
|
||||
nsAutoAnimationMutationBatch mb(mDocument);
|
||||
|
||||
for (Animation* animation = mAnimationOrder.getFirst(); animation;
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
#include "mozilla/AnimationUtils.h"
|
||||
#include "mozilla/EffectSet.h"
|
||||
#include "mozilla/LayerAnimationInfo.h"
|
||||
#include "mozilla/RestyleManagerHandle.h"
|
||||
#include "mozilla/RestyleManagerHandleInlines.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetPresShellForContent
|
||||
#include "nsCSSPropertyIDSet.h"
|
||||
#include "nsCSSProps.h"
|
||||
@@ -202,10 +201,7 @@ EffectCompositor::RequestRestyle(dom::Element* aElement,
|
||||
|
||||
if (aRestyleType == RestyleType::Layer) {
|
||||
// Prompt layers to re-sync their animations.
|
||||
MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(),
|
||||
"stylo: Servo-backed style system should not be using "
|
||||
"EffectCompositor");
|
||||
mPresContext->RestyleManager()->AsGecko()->IncrementAnimationGeneration();
|
||||
mPresContext->RestyleManager()->IncrementAnimationGeneration();
|
||||
EffectSet* effectSet =
|
||||
EffectSet::GetEffectSet(aElement, aPseudoType);
|
||||
if (effectSet) {
|
||||
@@ -317,10 +313,7 @@ EffectCompositor::GetAnimationRule(dom::Element* aElement,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(),
|
||||
"stylo: Servo-backed style system should not be using "
|
||||
"EffectCompositor");
|
||||
if (mPresContext->RestyleManager()->AsGecko()->SkipAnimationRules()) {
|
||||
if (mPresContext->RestyleManager()->SkipAnimationRules()) {
|
||||
// We don't need to worry about updating mElementsToRestyle in this case
|
||||
// since this is not the animation restyle we requested when we called
|
||||
// PostRestyleForAnimation (see comment at start of this method).
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include "EffectSet.h"
|
||||
#include "mozilla/dom/Element.h" // For Element
|
||||
#include "mozilla/RestyleManagerHandle.h"
|
||||
#include "mozilla/RestyleManagerHandleInlines.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
|
||||
#include "nsCycleCollectionNoteChild.h" // For CycleCollectionNoteChild
|
||||
#include "nsPresContext.h"
|
||||
@@ -110,11 +109,8 @@ EffectSet::DestroyEffectSet(dom::Element* aElement,
|
||||
void
|
||||
EffectSet::UpdateAnimationGeneration(nsPresContext* aPresContext)
|
||||
{
|
||||
MOZ_ASSERT(aPresContext->RestyleManager()->IsGecko(),
|
||||
"stylo: Servo-backed style system should not be using "
|
||||
"EffectSet");
|
||||
mAnimationGeneration =
|
||||
aPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration();
|
||||
aPresContext->RestyleManager()->GetAnimationGeneration();
|
||||
}
|
||||
|
||||
/* static */ nsIAtom**
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "mozilla/FloatingPoint.h" // For IsFinite
|
||||
#include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
|
||||
#include "mozilla/KeyframeUtils.h"
|
||||
#include "mozilla/ServoBindings.h"
|
||||
#include "mozilla/StyleAnimationValue.h"
|
||||
#include "Layers.h" // For Layer
|
||||
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContextForElement
|
||||
@@ -32,17 +31,7 @@ namespace mozilla {
|
||||
bool
|
||||
PropertyValuePair::operator==(const PropertyValuePair& aOther) const
|
||||
{
|
||||
if (mProperty != aOther.mProperty || mValue != aOther.mValue) {
|
||||
return false;
|
||||
}
|
||||
if (mServoDeclarationBlock == aOther.mServoDeclarationBlock) {
|
||||
return true;
|
||||
}
|
||||
if (!mServoDeclarationBlock || !aOther.mServoDeclarationBlock) {
|
||||
return false;
|
||||
}
|
||||
return Servo_DeclarationBlock_Equals(mServoDeclarationBlock,
|
||||
aOther.mServoDeclarationBlock);
|
||||
return mProperty == aOther.mProperty && mValue == aOther.mValue;
|
||||
}
|
||||
|
||||
namespace dom {
|
||||
@@ -296,10 +285,7 @@ KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
|
||||
runningOnCompositorProperties.HasProperty(property.mProperty);
|
||||
}
|
||||
|
||||
// FIXME (bug 1303235): Do this for Servo too
|
||||
if (aStyleContext->PresContext()->StyleSet()->IsGecko()) {
|
||||
CalculateCumulativeChangeHint(aStyleContext);
|
||||
}
|
||||
CalculateCumulativeChangeHint(aStyleContext);
|
||||
|
||||
MarkCascadeNeedsUpdate();
|
||||
|
||||
@@ -936,13 +922,8 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
|
||||
: propertyValue.mProperty;
|
||||
|
||||
nsAutoString stringValue;
|
||||
if (propertyValue.mServoDeclarationBlock) {
|
||||
Servo_DeclarationBlock_SerializeOneValue(
|
||||
propertyValue.mServoDeclarationBlock, &stringValue);
|
||||
} else {
|
||||
propertyValue.mValue.AppendToString(
|
||||
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
|
||||
}
|
||||
propertyValue.mValue.AppendToString(
|
||||
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
|
||||
|
||||
JS::Rooted<JS::Value> value(aCx);
|
||||
if (!ToJSValue(aCx, stringValue, &value) ||
|
||||
@@ -1286,10 +1267,8 @@ CreateStyleContextForAnimationValue(nsCSSPropertyID aProperty,
|
||||
nsCOMArray<nsIStyleRule> rules;
|
||||
rules.AppendObject(styleRule);
|
||||
|
||||
MOZ_ASSERT(aBaseStyleContext->PresContext()->StyleSet()->IsGecko(),
|
||||
"ServoStyleSet should not use StyleAnimationValue for animations");
|
||||
nsStyleSet* styleSet =
|
||||
aBaseStyleContext->PresContext()->StyleSet()->AsGecko();
|
||||
aBaseStyleContext->PresContext()->StyleSet();
|
||||
|
||||
RefPtr<nsStyleContext> styleContext =
|
||||
styleSet->ResolveStyleByAddingRules(aBaseStyleContext, rules);
|
||||
@@ -1362,10 +1341,8 @@ KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXME (bug 1303235): We don't calculate mCumulativeChangeHint for
|
||||
// the Servo backend yet
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (!presContext || presContext->StyleSet()->IsServo()) {
|
||||
if (!presContext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#include "mozilla/EffectCompositor.h"
|
||||
#include "mozilla/KeyframeEffectParams.h"
|
||||
#include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords
|
||||
#include "mozilla/ServoBindingTypes.h" // RawServoDeclarationBlock and
|
||||
// associated RefPtrTraits
|
||||
#include "mozilla/StyleAnimationValue.h"
|
||||
#include "mozilla/dom/AnimationEffectReadOnly.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
@@ -63,11 +61,6 @@ struct PropertyValuePair
|
||||
// (string).
|
||||
nsCSSValue mValue;
|
||||
|
||||
// The specified value when using the Servo backend. However, even when
|
||||
// using the Servo backend, we still fill in |mValue| in the case where we
|
||||
// fail to parse the value since we use it to store the original string.
|
||||
RefPtr<RawServoDeclarationBlock> mServoDeclarationBlock;
|
||||
|
||||
bool operator==(const PropertyValuePair&) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/RangedArray.h"
|
||||
#include "mozilla/ServoBindings.h"
|
||||
#include "mozilla/StyleAnimationValue.h"
|
||||
#include "mozilla/TimingParams.h"
|
||||
#include "mozilla/dom/BaseKeyframeTypesBinding.h" // For FastBaseKeyframe etc.
|
||||
@@ -319,12 +318,8 @@ public:
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline bool
|
||||
IsInvalidValuePair(const PropertyValuePair& aPair, StyleBackendType aBackend)
|
||||
IsInvalidValuePair(const PropertyValuePair& aPair)
|
||||
{
|
||||
if (aBackend == StyleBackendType::Servo) {
|
||||
return !aPair.mServoDeclarationBlock;
|
||||
}
|
||||
|
||||
// There are three types of values we store as token streams:
|
||||
//
|
||||
// * Shorthand values (where we manually extract the token stream's string
|
||||
@@ -600,8 +595,6 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
|
||||
MOZ_ASSERT(aStyleContext);
|
||||
MOZ_ASSERT(aElement);
|
||||
|
||||
StyleBackendType styleBackend = aElement->OwnerDoc()->GetStyleBackendType();
|
||||
|
||||
const size_t len = aKeyframes.Length();
|
||||
nsTArray<ComputedKeyframeValues> result(len);
|
||||
|
||||
@@ -610,12 +603,7 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
|
||||
ComputedKeyframeValues* computedValues = result.AppendElement();
|
||||
for (const PropertyValuePair& pair :
|
||||
PropertyPriorityIterator(frame.mPropertyValues)) {
|
||||
MOZ_ASSERT(!pair.mServoDeclarationBlock ||
|
||||
styleBackend == StyleBackendType::Servo,
|
||||
"Animation values were parsed using Servo backend but target"
|
||||
" element is not using Servo backend?");
|
||||
|
||||
if (IsInvalidValuePair(pair, styleBackend)) {
|
||||
if (IsInvalidValuePair(pair)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -623,33 +611,25 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
|
||||
// a KeyframeValueEntry for each value.
|
||||
nsTArray<PropertyStyleAnimationValuePair> values;
|
||||
|
||||
if (styleBackend == StyleBackendType::Servo) {
|
||||
// For shorthands, we store the string as a token stream so we need to
|
||||
// extract that first.
|
||||
if (nsCSSProps::IsShorthand(pair.mProperty)) {
|
||||
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
|
||||
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
|
||||
CSSEnabledState::eForAllContent, aStyleContext,
|
||||
*pair.mServoDeclarationBlock, values)) {
|
||||
CSSEnabledState::eForAllContent, aElement, aStyleContext,
|
||||
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
|
||||
IsComputeValuesFailureKey(pair)) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// For shorthands, we store the string as a token stream so we need to
|
||||
// extract that first.
|
||||
if (nsCSSProps::IsShorthand(pair.mProperty)) {
|
||||
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
|
||||
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
|
||||
CSSEnabledState::eForAllContent, aElement, aStyleContext,
|
||||
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
|
||||
IsComputeValuesFailureKey(pair)) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
|
||||
CSSEnabledState::eForAllContent, aElement, aStyleContext,
|
||||
pair.mValue, /* aUseSVGMode */ false, values)) {
|
||||
continue;
|
||||
}
|
||||
MOZ_ASSERT(values.Length() == 1,
|
||||
"Longhand properties should produce a single"
|
||||
" StyleAnimationValue");
|
||||
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
|
||||
CSSEnabledState::eForAllContent, aElement, aStyleContext,
|
||||
pair.mValue, /* aUseSVGMode */ false, values)) {
|
||||
continue;
|
||||
}
|
||||
MOZ_ASSERT(values.Length() == 1,
|
||||
"Longhand properties should produce a single"
|
||||
" StyleAnimationValue");
|
||||
}
|
||||
|
||||
for (auto& value : values) {
|
||||
@@ -999,30 +979,6 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
|
||||
|
||||
result.mProperty = aProperty;
|
||||
|
||||
if (aDocument->GetStyleBackendType() == StyleBackendType::Servo) {
|
||||
nsCString name = nsCSSProps::GetStringValue(aProperty);
|
||||
|
||||
NS_ConvertUTF16toUTF8 value(aStringValue);
|
||||
RefPtr<ThreadSafeURIHolder> base =
|
||||
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
|
||||
RefPtr<ThreadSafeURIHolder> referrer =
|
||||
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
|
||||
RefPtr<ThreadSafePrincipalHolder> principal =
|
||||
new ThreadSafePrincipalHolder(aDocument->NodePrincipal());
|
||||
|
||||
nsCString baseString;
|
||||
aDocument->GetDocumentURI()->GetSpec(baseString);
|
||||
|
||||
RefPtr<RawServoDeclarationBlock> servoDeclarationBlock =
|
||||
Servo_ParseProperty(&name, &value, &baseString,
|
||||
base, referrer, principal).Consume();
|
||||
|
||||
if (servoDeclarationBlock) {
|
||||
result.mServoDeclarationBlock = servoDeclarationBlock.forget();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
nsCSSValue value;
|
||||
if (!nsCSSProps::IsShorthand(aProperty)) {
|
||||
aParser.ParseLonghandProperty(aProperty,
|
||||
@@ -1054,13 +1010,6 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
|
||||
"The shorthand property of a token stream should be initialized"
|
||||
" to unknown");
|
||||
value.SetTokenStreamValue(tokenStream);
|
||||
} else {
|
||||
// If we succeeded in parsing with Gecko, but not Servo the animation is
|
||||
// not going to work since, for the purposes of animation, we're going to
|
||||
// ignore |mValue| when the backend is Servo.
|
||||
NS_WARNING_ASSERTION(aDocument->GetStyleBackendType() !=
|
||||
StyleBackendType::Servo,
|
||||
"Gecko succeeded in parsing where Servo failed");
|
||||
}
|
||||
|
||||
result.mValue = value;
|
||||
@@ -1412,8 +1361,6 @@ HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
|
||||
}
|
||||
};
|
||||
|
||||
StyleBackendType styleBackend = aDocument->GetStyleBackendType();
|
||||
|
||||
for (size_t i = 0, len = aKeyframes.Length(); i < len; i++) {
|
||||
const Keyframe& frame = aKeyframes[i];
|
||||
|
||||
@@ -1429,25 +1376,18 @@ HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
|
||||
: computedOffset;
|
||||
|
||||
for (const PropertyValuePair& pair : frame.mPropertyValues) {
|
||||
if (IsInvalidValuePair(pair, styleBackend)) {
|
||||
if (IsInvalidValuePair(pair)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nsCSSProps::IsShorthand(pair.mProperty)) {
|
||||
if (styleBackend == StyleBackendType::Gecko) {
|
||||
nsCSSValueTokenStream* tokenStream =
|
||||
pair.mValue.GetTokenStreamValue();
|
||||
nsCSSParser parser(aDocument->CSSLoader());
|
||||
if (!parser.IsValueValidForProperty(pair.mProperty,
|
||||
tokenStream->mTokenStream)) {
|
||||
continue;
|
||||
}
|
||||
nsCSSValueTokenStream* tokenStream =
|
||||
pair.mValue.GetTokenStreamValue();
|
||||
nsCSSParser parser(aDocument->CSSLoader());
|
||||
if (!parser.IsValueValidForProperty(pair.mProperty,
|
||||
tokenStream->mTokenStream)) {
|
||||
continue;
|
||||
}
|
||||
// For the Servo backend, invalid shorthand values are represented by
|
||||
// a null mServoDeclarationBlock member which we skip above in
|
||||
// IsInvalidValuePair.
|
||||
MOZ_ASSERT(styleBackend != StyleBackendType::Servo ||
|
||||
pair.mServoDeclarationBlock);
|
||||
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
|
||||
prop, pair.mProperty, CSSEnabledState::eForAllContent) {
|
||||
addToPropertySets(*prop, offsetToUse);
|
||||
|
||||
@@ -135,7 +135,7 @@ TimingParams::ParseEasing(const nsAString& aEasing,
|
||||
NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR) {
|
||||
return Nothing();
|
||||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case eCSSUnit_Cubic_Bezier:
|
||||
case eCSSUnit_Steps: {
|
||||
nsTimingFunction timingFunction;
|
||||
|
||||
@@ -474,10 +474,7 @@ IsNativeAnonymousImplementationOfPseudoElement(nsIContent* aContent)
|
||||
// Unlike regular nodes, native anonymous content (NAC) gets created during
|
||||
// frame construction, which happens after the main style traversal. This
|
||||
// means that we have to manually resolve style for those nodes shortly after
|
||||
// they're created, either by (a) invoking ResolvePseudoElementStyle (for PE
|
||||
// NAC), or (b) handing the subtree off to Servo for a mini-traversal (for
|
||||
// non-PE NAC). We have assertions in nsCSSFrameConstructor that we don't do
|
||||
// both.
|
||||
// they're created by invoking ResolvePseudoElementStyle (for PE NAC).
|
||||
//
|
||||
// Once that happens, the NAC has a frame. So if we have no frame here,
|
||||
// we're either not NAC, or in the process of doing (b). Either way, this
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "mozilla/dom/CustomElementRegistry.h"
|
||||
|
||||
#include "mozilla/CycleCollectedJSContext.h"
|
||||
#include "mozilla/dom/CustomElementRegistryBinding.h"
|
||||
#include "mozilla/dom/HTMLElementBinding.h"
|
||||
#include "mozilla/dom/WebComponentsBinding.h"
|
||||
@@ -1153,7 +1152,7 @@ CustomElementReactionsStack::Enqueue(Element* aElement,
|
||||
|
||||
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
|
||||
RefPtr<BackupQueueMicroTask> bqmt = new BackupQueueMicroTask(this);
|
||||
context->DispatchMicroTaskRunnable(bqmt.forget());
|
||||
context->DispatchToMicroTask(bqmt.forget());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "js/GCHashTable.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/CycleCollectedJSContext.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/FunctionBinding.h"
|
||||
|
||||
@@ -80,7 +80,14 @@ DOMIntersectionObserver::Constructor(const mozilla::dom::GlobalObject& aGlobal,
|
||||
RefPtr<DOMIntersectionObserver> observer =
|
||||
new DOMIntersectionObserver(window.forget(), aCb);
|
||||
|
||||
observer->mRoot = aOptions.mRoot;
|
||||
if (!aOptions.mRoot.IsNull()) {
|
||||
if (aOptions.mRoot.Value().IsElement()) {
|
||||
observer->mRoot = aOptions.mRoot.Value().GetAsElement();
|
||||
} else {
|
||||
MOZ_ASSERT(aOptions.mRoot.Value().IsDocument());
|
||||
observer->mRoot = aOptions.mRoot.Value().GetAsDocument();
|
||||
}
|
||||
}
|
||||
|
||||
if (!observer->SetRootMargin(aOptions.mRootMargin)) {
|
||||
aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
|
||||
@@ -258,6 +265,30 @@ EdgeInclusiveIntersection(const nsRect& aRect, const nsRect& aOtherRect)
|
||||
return Some(nsRect(left, top, right - left, bottom - top));
|
||||
}
|
||||
|
||||
// NOTE: This returns nullptr if |aDocument| is in a cross process.
|
||||
static nsIDocument* GetTopLevelDocument(const nsIDocument& aDocument) {
|
||||
nsCOMPtr<nsIPresShell> presShell = aDocument.GetShell();
|
||||
|
||||
if (presShell) {
|
||||
nsIFrame* rootFrame = presShell->GetRootScrollFrame();
|
||||
if (rootFrame) {
|
||||
nsPresContext* presContext = rootFrame->PresContext();
|
||||
while (!presContext->IsRootContentDocument()) {
|
||||
// Walk up the tree
|
||||
presContext = presContext->GetParentPresContext();
|
||||
if (!presContext) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(presContext && presContext->IsRootContentDocument()) {
|
||||
return presContext->Document();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
enum class BrowsingContextInfo {
|
||||
SimilarOriginBrowsingContext,
|
||||
DifferentOriginBrowsingContext,
|
||||
@@ -267,14 +298,12 @@ enum class BrowsingContextInfo {
|
||||
void
|
||||
DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time)
|
||||
{
|
||||
Element* root = nullptr;
|
||||
nsINode* root = mRoot;
|
||||
nsIFrame* rootFrame = nullptr;
|
||||
nsRect rootRect;
|
||||
|
||||
if (mRoot) {
|
||||
root = mRoot;
|
||||
rootFrame = root->GetPrimaryFrame();
|
||||
if (rootFrame) {
|
||||
if (mRoot && mRoot->IsElement()) {
|
||||
if ((rootFrame = mRoot->AsElement()->GetPrimaryFrame())) {
|
||||
nsRect rootRectRelativeToRootFrame;
|
||||
if (rootFrame->GetType() == nsGkAtoms::scrollFrame) {
|
||||
// rootRectRelativeToRootFrame should be the content rect of rootFrame, not including the scrollbars.
|
||||
@@ -292,30 +321,18 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
||||
containingBlock);
|
||||
}
|
||||
} else {
|
||||
nsCOMPtr<nsIPresShell> presShell = aDocument->GetShell();
|
||||
if (presShell) {
|
||||
rootFrame = presShell->GetRootScrollFrame();
|
||||
if (rootFrame) {
|
||||
nsPresContext* presContext = rootFrame->PresContext();
|
||||
while (!presContext->IsRootContentDocument()) {
|
||||
// Walk up the tree
|
||||
presContext = presContext->GetParentPresContext();
|
||||
if (!presContext) {
|
||||
break;
|
||||
MOZ_ASSERT(!mRoot || mRoot->IsInUncomposedDoc());
|
||||
nsIDocument* rootDocument =
|
||||
mRoot ? mRoot->GetUncomposedDoc() : GetTopLevelDocument(*aDocument);
|
||||
if (rootDocument) {
|
||||
if (nsIPresShell* presShell = rootDocument->GetShell()) {
|
||||
rootFrame = presShell->GetRootScrollFrame();
|
||||
if (rootFrame) {
|
||||
root = rootFrame->GetContent()->AsElement();
|
||||
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
|
||||
if (scrollFrame) {
|
||||
rootRect = scrollFrame->GetScrollPortRect();
|
||||
}
|
||||
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
|
||||
if (rootScrollFrame) {
|
||||
rootFrame = rootScrollFrame;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
root = rootFrame->GetContent()->AsElement();
|
||||
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
|
||||
// If we end up with a null root frame for some reason, we'll proceed
|
||||
// with an empty root intersection rect.
|
||||
if (scrollFrame) {
|
||||
rootRect = scrollFrame->GetScrollPortRect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
return mOwner;
|
||||
}
|
||||
|
||||
Element* GetRoot() const {
|
||||
nsINode* GetRoot() const {
|
||||
return mRoot;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ protected:
|
||||
nsCOMPtr<nsPIDOMWindowInner> mOwner;
|
||||
RefPtr<nsIDocument> mDocument;
|
||||
RefPtr<mozilla::dom::IntersectionCallback> mCallback;
|
||||
RefPtr<Element> mRoot;
|
||||
RefPtr<nsINode> mRoot;
|
||||
nsCSSRect mRootMargin;
|
||||
nsTArray<double> mThresholds;
|
||||
|
||||
|
||||
@@ -117,6 +117,17 @@ ValidateAndFixupMatrixInit(DOMMatrixInit& aMatrixInit, ErrorResult& aRv)
|
||||
#undef Check3DField
|
||||
}
|
||||
|
||||
void
|
||||
DOMMatrixReadOnly::SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit) {
|
||||
MOZ_ASSERT(Is2D());
|
||||
mMatrix2D->_11 = aMatrixInit.mM11.Value();
|
||||
mMatrix2D->_12 = aMatrixInit.mM12.Value();
|
||||
mMatrix2D->_21 = aMatrixInit.mM21.Value();
|
||||
mMatrix2D->_22 = aMatrixInit.mM22.Value();
|
||||
mMatrix2D->_31 = aMatrixInit.mM41.Value();
|
||||
mMatrix2D->_32 = aMatrixInit.mM42.Value();
|
||||
}
|
||||
|
||||
void
|
||||
DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
|
||||
{
|
||||
@@ -149,6 +160,34 @@ DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<DOMMatrixReadOnly> DOMMatrixReadOnly::FromMatrix(
|
||||
nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit,
|
||||
ErrorResult& aRv) {
|
||||
DOMMatrix2DInit matrixInit(aMatrixInit);
|
||||
if (!ValidateAndFixupMatrix2DInit(matrixInit, aRv)) {
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
RefPtr<DOMMatrixReadOnly> matrix =
|
||||
new DOMMatrixReadOnly(aParent, /* is2D */ true);
|
||||
matrix->SetDataFromMatrix2DInit(matrixInit);
|
||||
return matrix.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMMatrixReadOnly> DOMMatrixReadOnly::FromMatrix(
|
||||
nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv) {
|
||||
DOMMatrixInit matrixInit(aMatrixInit);
|
||||
if (!ValidateAndFixupMatrixInit(matrixInit, aRv)) {
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
RefPtr<DOMMatrixReadOnly> rval =
|
||||
new DOMMatrixReadOnly(aParent, matrixInit.mIs2D.Value());
|
||||
rval->SetDataFromMatrixInit(matrixInit);
|
||||
return rval.forget();
|
||||
|
||||
}
|
||||
|
||||
already_AddRefed<DOMMatrixReadOnly>
|
||||
DOMMatrixReadOnly::FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ class DOMPoint;
|
||||
class StringOrUnrestrictedDoubleSequence;
|
||||
struct DOMPointInit;
|
||||
struct DOMMatrixInit;
|
||||
struct DOMMatrix2DInit;
|
||||
|
||||
class DOMMatrixReadOnly : public nsWrapperCache
|
||||
{
|
||||
@@ -57,6 +58,12 @@ public:
|
||||
nsISupports* GetParentObject() const { return mParent; }
|
||||
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
static already_AddRefed<DOMMatrixReadOnly>
|
||||
FromMatrix(nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit, ErrorResult& aRv);
|
||||
|
||||
static already_AddRefed<DOMMatrixReadOnly>
|
||||
FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
|
||||
|
||||
static already_AddRefed<DOMMatrixReadOnly>
|
||||
FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
|
||||
|
||||
@@ -207,6 +214,12 @@ public:
|
||||
ErrorResult& aRv) const;
|
||||
void Stringify(nsAString& aResult);
|
||||
bool WriteStructuredClone(JSStructuredCloneWriter* aWriter) const;
|
||||
const gfx::Matrix* GetInternal2D() const {
|
||||
if (Is2D()) {
|
||||
return mMatrix2D;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsISupports> mParent;
|
||||
@@ -220,6 +233,7 @@ protected:
|
||||
* where all of its members are properly defined.
|
||||
* The init dictionary's dimension must match the matrix one.
|
||||
*/
|
||||
void SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit);
|
||||
void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit);
|
||||
|
||||
DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv);
|
||||
|
||||
@@ -169,7 +169,7 @@ DocumentOrShadowRoot::GetFullscreenElement()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Element* element = AsNode().OwnerDoc()->FullScreenStackTop();
|
||||
Element* element = AsNode().OwnerDoc()->GetUnretargetedFullScreenElement();
|
||||
NS_ASSERTION(!element ||
|
||||
element->State().HasState(NS_EVENT_STATE_FULL_SCREEN),
|
||||
"Fullscreen element should have fullscreen styles applied");
|
||||
|
||||
+30
-31
@@ -56,7 +56,6 @@
|
||||
#include "mozilla/AnimationComparator.h"
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/ContentEvents.h"
|
||||
#include "mozilla/DeclarationBlockInlines.h"
|
||||
#include "mozilla/EffectSet.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
@@ -106,6 +105,7 @@
|
||||
#include "nsViewManager.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#include "nsCSSRuleProcessor.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
#include "nsTextNode.h"
|
||||
@@ -1481,6 +1481,27 @@ Element::GetElementsByClassName(const nsAString& aClassNames,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
CSSPseudoElementType
|
||||
Element::GetPseudoElementType() const {
|
||||
if (!HasProperties()) {
|
||||
return CSSPseudoElementType::NotPseudo;
|
||||
}
|
||||
nsresult rv = NS_OK;
|
||||
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
|
||||
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
|
||||
return CSSPseudoElementType::NotPseudo;
|
||||
}
|
||||
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
|
||||
}
|
||||
|
||||
void
|
||||
Element::SetPseudoElementType(CSSPseudoElementType aPseudo) {
|
||||
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
|
||||
"Need to be able to store this in a void*");
|
||||
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
|
||||
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the count of descendants (inclusive of aContent) in
|
||||
* the uncomposed document that are explicitly set as editable.
|
||||
@@ -1607,7 +1628,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
// And clear the lazy frame construction bits.
|
||||
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
|
||||
// And the restyle bits
|
||||
UnsetRestyleFlagsIfGecko();
|
||||
UnsetRestyleFlags();
|
||||
} else if (IsInShadowTree()) {
|
||||
// We're not in a document, but we did get inserted into a shadow tree.
|
||||
// Since we won't have any restyle data in the document's restyle trackers,
|
||||
@@ -1617,7 +1638,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
// inserted into a document.
|
||||
UnsetFlags(NODE_FORCE_XBL_BINDINGS |
|
||||
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
|
||||
UnsetRestyleFlagsIfGecko();
|
||||
UnsetRestyleFlags();
|
||||
} else {
|
||||
// If we're not in the doc and not in a shadow tree,
|
||||
// update our subtree pointer.
|
||||
@@ -1758,18 +1779,6 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
}
|
||||
}
|
||||
|
||||
// It would be cleanest to mark nodes as dirty when (a) they're created and
|
||||
// (b) they're unbound from a tree. However, we can't easily do (a) right now,
|
||||
// because IsStyledByServo() is not always easy to check at node creation time,
|
||||
// and the bits have different meaning in the non-IsStyledByServo case.
|
||||
//
|
||||
// So for now, we just mark nodes as dirty when they're inserted into a
|
||||
// document or shadow tree.
|
||||
if (IsStyledByServo() && IsInComposedDoc()) {
|
||||
MOZ_ASSERT(!HasServoData());
|
||||
SetIsDirtyForServo();
|
||||
}
|
||||
|
||||
// XXXbz script execution during binding can trigger some of these
|
||||
// postcondition asserts.... But we do want that, since things will
|
||||
// generally be quite broken when that happens.
|
||||
@@ -1896,16 +1905,6 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
|
||||
ClearInDocument();
|
||||
|
||||
// Computed styled data isn't useful for detached nodes, and we'll need to
|
||||
// recomputed it anyway if we ever insert the nodes back into a document.
|
||||
if (IsStyledByServo()) {
|
||||
ClearServoData();
|
||||
} else {
|
||||
#ifdef MOZ_STYLO
|
||||
MOZ_ASSERT(!HasServoData());
|
||||
#endif
|
||||
}
|
||||
|
||||
// Editable descendant count only counts descendants that
|
||||
// are in the uncomposed document.
|
||||
ResetEditableDescendantCount();
|
||||
@@ -2015,7 +2014,7 @@ Element::GetSMILOverrideStyle()
|
||||
return slots->mSMILOverrideStyle;
|
||||
}
|
||||
|
||||
DeclarationBlock*
|
||||
css::Declaration*
|
||||
Element::GetSMILOverrideStyleDeclaration()
|
||||
{
|
||||
Element::nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
|
||||
@@ -2023,7 +2022,7 @@ Element::GetSMILOverrideStyleDeclaration()
|
||||
}
|
||||
|
||||
nsresult
|
||||
Element::SetSMILOverrideStyleDeclaration(DeclarationBlock* aDeclaration,
|
||||
Element::SetSMILOverrideStyleDeclaration(css::Declaration* aDeclaration,
|
||||
bool aNotify)
|
||||
{
|
||||
Element::nsExtendedDOMSlots* slots = ExtendedDOMSlots();
|
||||
@@ -2063,14 +2062,14 @@ Element::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
return false;
|
||||
}
|
||||
|
||||
DeclarationBlock*
|
||||
css::Declaration*
|
||||
Element::GetInlineStyleDeclaration()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsresult
|
||||
Element::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
|
||||
Element::SetInlineStyleDeclaration(css::Declaration* aDeclaration,
|
||||
const nsAString* aSerialized,
|
||||
bool aNotify)
|
||||
{
|
||||
@@ -3199,7 +3198,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor)
|
||||
// Set the status bar similarly for mouseover and focus
|
||||
case eMouseOver:
|
||||
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||
MOZ_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case eFocus: {
|
||||
InternalFocusEvent* focusEvent = aVisitor.mEvent->AsFocusEvent();
|
||||
if (!focusEvent || !focusEvent->mIsRefocus) {
|
||||
@@ -3214,7 +3213,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor)
|
||||
}
|
||||
case eMouseOut:
|
||||
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||
MOZ_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case eBlur:
|
||||
rv = LeaveLink(aVisitor.mPresContext);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
||||
+18
-31
@@ -57,7 +57,9 @@ class nsDocument;
|
||||
class nsDOMStringMap;
|
||||
|
||||
namespace mozilla {
|
||||
class DeclarationBlock;
|
||||
namespace css {
|
||||
class Declaration;
|
||||
} // namespace css
|
||||
namespace dom {
|
||||
struct AnimationFilter;
|
||||
struct ScrollIntoViewOptions;
|
||||
@@ -79,27 +81,27 @@ NS_GetContentList(nsINode* aRootNode,
|
||||
// Element-specific flags
|
||||
enum {
|
||||
// Set if the element has a pending style change.
|
||||
ELEMENT_HAS_PENDING_RESTYLE = NODE_SHARED_RESTYLE_BIT_1,
|
||||
ELEMENT_HAS_PENDING_RESTYLE = ELEMENT_FLAG_BIT(0),
|
||||
|
||||
// Set if the element is a potential restyle root (that is, has a style
|
||||
// change pending _and_ that style change will attempt to restyle
|
||||
// descendants).
|
||||
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = NODE_SHARED_RESTYLE_BIT_2,
|
||||
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1),
|
||||
|
||||
// Set if the element has a pending animation-only style change as
|
||||
// part of an animation-only style update (where we update styles from
|
||||
// animation to the current refresh tick, but leave everything else as
|
||||
// it was).
|
||||
ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(0),
|
||||
ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(2),
|
||||
|
||||
// Set if the element is a potential animation-only restyle root (that
|
||||
// is, has an animation-only style change pending _and_ that style
|
||||
// change will attempt to restyle descendants).
|
||||
ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1),
|
||||
ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(3),
|
||||
|
||||
// Set if this element has a pending restyle with an eRestyle_SomeDescendants
|
||||
// restyle hint.
|
||||
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(2),
|
||||
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(4),
|
||||
|
||||
// Just the HAS_PENDING bits, for convenience
|
||||
ELEMENT_PENDING_RESTYLE_FLAGS =
|
||||
@@ -117,10 +119,10 @@ enum {
|
||||
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR,
|
||||
|
||||
// Set if this element is marked as 'scrollgrab' (see bug 912666)
|
||||
ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(3),
|
||||
ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(5),
|
||||
|
||||
// Remaining bits are for subclasses
|
||||
ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 4
|
||||
ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 6
|
||||
};
|
||||
|
||||
#undef ELEMENT_FLAG_BIT
|
||||
@@ -274,13 +276,13 @@ public:
|
||||
/**
|
||||
* Get the inline style declaration, if any, for this element.
|
||||
*/
|
||||
virtual DeclarationBlock* GetInlineStyleDeclaration();
|
||||
virtual css::Declaration* GetInlineStyleDeclaration();
|
||||
|
||||
/**
|
||||
* Set the inline style declaration for this element. This will send
|
||||
* an appropriate AttributeChanged notification if aNotify is true.
|
||||
*/
|
||||
virtual nsresult SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
|
||||
virtual nsresult SetInlineStyleDeclaration(css::Declaration* aDeclaration,
|
||||
const nsAString* aSerialized,
|
||||
bool aNotify);
|
||||
|
||||
@@ -288,7 +290,7 @@ public:
|
||||
* Get the SMIL override style declaration for this element. If the
|
||||
* rule hasn't been created, this method simply returns null.
|
||||
*/
|
||||
virtual DeclarationBlock* GetSMILOverrideStyleDeclaration();
|
||||
virtual css::Declaration* GetSMILOverrideStyleDeclaration();
|
||||
|
||||
/**
|
||||
* Set the SMIL override style declaration for this element. If
|
||||
@@ -296,7 +298,7 @@ public:
|
||||
* context, so that the style changes will be noticed.
|
||||
*/
|
||||
virtual nsresult SetSMILOverrideStyleDeclaration(
|
||||
DeclarationBlock* aDeclaration, bool aNotify);
|
||||
css::Declaration* aDeclaration, bool aNotify);
|
||||
|
||||
/**
|
||||
* Returns a new nsISMILAttr that allows the caller to animate the given
|
||||
@@ -814,24 +816,9 @@ public:
|
||||
already_AddRefed<nsIHTMLCollection>
|
||||
GetElementsByClassName(const nsAString& aClassNames);
|
||||
|
||||
CSSPseudoElementType GetPseudoElementType() const {
|
||||
if (!HasProperties()) {
|
||||
return CSSPseudoElementType::NotPseudo;
|
||||
}
|
||||
nsresult rv = NS_OK;
|
||||
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
|
||||
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
|
||||
return CSSPseudoElementType::NotPseudo;
|
||||
}
|
||||
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
|
||||
}
|
||||
CSSPseudoElementType GetPseudoElementType() const;
|
||||
|
||||
void SetPseudoElementType(CSSPseudoElementType aPseudo) {
|
||||
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
|
||||
"Need to be able to store this in a void*");
|
||||
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
|
||||
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
|
||||
}
|
||||
void SetPseudoElementType(CSSPseudoElementType aPseudo);
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -1662,9 +1649,9 @@ inline const mozilla::dom::Element* nsINode::AsElement() const
|
||||
return static_cast<const mozilla::dom::Element*>(this);
|
||||
}
|
||||
|
||||
inline void nsINode::UnsetRestyleFlagsIfGecko()
|
||||
inline void nsINode::UnsetRestyleFlags()
|
||||
{
|
||||
if (IsElement() && !IsStyledByServo()) {
|
||||
if (IsElement()) {
|
||||
UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "mozilla/dom/FragmentOrElement.h"
|
||||
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/DeclarationBlockInlines.h"
|
||||
#include "mozilla/EffectSet.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
@@ -97,6 +96,7 @@
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "ChildIterator.h"
|
||||
#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
#include "nsTextNode.h"
|
||||
#include "mozilla/dom/NodeListBinding.h"
|
||||
@@ -2527,51 +2527,3 @@ FragmentOrElement::SetIsElementInStyleScopeFlagOnShadowTree(bool aInStyleScope)
|
||||
shadowRoot->SetIsElementInStyleScopeFlagOnSubtree(aInStyleScope);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
AssertDirtyDescendantsBitPropagated(nsINode* aNode)
|
||||
{
|
||||
MOZ_ASSERT(aNode->HasDirtyDescendantsForServo());
|
||||
nsINode* parent = aNode->GetFlattenedTreeParentNode();
|
||||
if (!parent->IsContent()) {
|
||||
MOZ_ASSERT(parent == aNode->OwnerDoc());
|
||||
MOZ_ASSERT(parent->HasDirtyDescendantsForServo());
|
||||
} else {
|
||||
AssertDirtyDescendantsBitPropagated(parent);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void AssertDirtyDescendantsBitPropagated(nsINode* aNode) {}
|
||||
#endif
|
||||
|
||||
void
|
||||
nsIContent::MarkAncestorsAsHavingDirtyDescendantsForServo()
|
||||
{
|
||||
MOZ_ASSERT(IsInComposedDoc());
|
||||
|
||||
// Get the parent in the flattened tree.
|
||||
nsINode* parent = GetFlattenedTreeParentNode();
|
||||
|
||||
// Loop until we hit a base case.
|
||||
while (true) {
|
||||
|
||||
// Base case: the document.
|
||||
if (!parent->IsContent()) {
|
||||
MOZ_ASSERT(parent == OwnerDoc());
|
||||
parent->SetHasDirtyDescendantsForServo();
|
||||
return;
|
||||
}
|
||||
|
||||
// Base case: the parent is already marked, and therefore
|
||||
// so are all its ancestors.
|
||||
if (parent->HasDirtyDescendantsForServo()) {
|
||||
AssertDirtyDescendantsBitPropagated(parent);
|
||||
return;
|
||||
}
|
||||
|
||||
// Mark the parent and iterate.
|
||||
parent->SetHasDirtyDescendantsForServo();
|
||||
parent = parent->GetFlattenedTreeParentNode();
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,9 @@ class nsDOMStringMap;
|
||||
class nsIURI;
|
||||
|
||||
namespace mozilla {
|
||||
class DeclarationBlock;
|
||||
namespace css {
|
||||
class Declaration;
|
||||
}
|
||||
namespace dom {
|
||||
struct CustomElementData;
|
||||
class DOMIntersectionObserver;
|
||||
@@ -264,7 +266,7 @@ public:
|
||||
/**
|
||||
* Holds any SMIL override style declaration for this element.
|
||||
*/
|
||||
RefPtr<mozilla::DeclarationBlock> mSMILOverrideStyleDeclaration;
|
||||
RefPtr<mozilla::css::Declaration> mSMILOverrideStyleDeclaration;
|
||||
|
||||
/**
|
||||
* The nearest enclosing content node with a binding that created us.
|
||||
|
||||
+306
-5
@@ -15,6 +15,7 @@
|
||||
#include "nsCPrefetchService.h"
|
||||
#include "nsStyleLinkElement.h"
|
||||
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsHTMLDNSPrefetch.h"
|
||||
@@ -23,9 +24,57 @@
|
||||
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
#include "nsIContentPolicy.h"
|
||||
#include "nsCSSParser.h"
|
||||
#include "nsMimeTypes.h"
|
||||
#include "nsIMediaList.h"
|
||||
#include "DecoderTraits.h"
|
||||
#include "imgLoader.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
enum Destination : uint8_t
|
||||
{
|
||||
DESTINATION_INVALID,
|
||||
DESTINATION_AUDIO,
|
||||
DESTINATION_AUDIOWORKLET,
|
||||
DESTINATION_DOCUMENT,
|
||||
DESTINATION_EMBED,
|
||||
DESTINATION_FONT,
|
||||
DESTINATION_FRAME,
|
||||
DESTINATION_IFRAME,
|
||||
DESTINATION_IMAGE,
|
||||
DESTINATION_JSON,
|
||||
DESTINATION_MANIFEST,
|
||||
DESTINATION_OBJECT,
|
||||
DESTINATION_REPORT,
|
||||
DESTINATION_SCRIPT,
|
||||
DESTINATION_SERVICEWORKER,
|
||||
DESTINATION_SHAREDWORKER,
|
||||
DESTINATION_STYLE,
|
||||
DESTINATION_TRACK,
|
||||
DESTINATION_VIDEO,
|
||||
DESTINATION_WEBIDENTITY,
|
||||
DESTINATION_WORKER,
|
||||
DESTINATION_XSLT,
|
||||
DESTINATION_FETCH
|
||||
};
|
||||
|
||||
static const nsAttrValue::EnumTable kDestinationAttributeTable[] = {
|
||||
{ "", DESTINATION_INVALID },
|
||||
{ "audio", DESTINATION_AUDIO },
|
||||
{ "font", DESTINATION_FONT },
|
||||
{ "image", DESTINATION_IMAGE },
|
||||
{ "script", DESTINATION_SCRIPT },
|
||||
{ "style", DESTINATION_STYLE },
|
||||
{ "track", DESTINATION_TRACK },
|
||||
{ "video", DESTINATION_VIDEO },
|
||||
{ "fetch", DESTINATION_FETCH },
|
||||
{ "json", DESTINATION_JSON },
|
||||
{ nullptr, 0 }
|
||||
};
|
||||
|
||||
Link::Link(Element *aElement)
|
||||
: mElement(aElement)
|
||||
, mHistory(services::GetHistoryService())
|
||||
@@ -75,7 +124,7 @@ Link::CancelDNSPrefetch(nsWrapperCache::FlagsType aDeferredFlag,
|
||||
}
|
||||
|
||||
void
|
||||
Link::TryDNSPrefetchPreconnectOrPrefetch()
|
||||
Link::TrySpeculativeLoadFeature()
|
||||
{
|
||||
MOZ_ASSERT(mElement->IsInComposedDoc());
|
||||
if (!ElementHasHref()) {
|
||||
@@ -95,15 +144,28 @@ Link::TryDNSPrefetchPreconnectOrPrefetch()
|
||||
mElement->NodePrincipal());
|
||||
|
||||
if ((linkTypes & nsStyleLinkElement::ePREFETCH) ||
|
||||
(linkTypes & nsStyleLinkElement::eNEXT)){
|
||||
(linkTypes & nsStyleLinkElement::eNEXT) ||
|
||||
(linkTypes & nsStyleLinkElement::ePRELOAD)) {
|
||||
nsCOMPtr<nsIPrefetchService> prefetchService(do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
|
||||
if (prefetchService) {
|
||||
nsCOMPtr<nsIURI> uri(GetURI());
|
||||
if (uri) {
|
||||
nsCOMPtr<nsIDOMNode> domNode = GetAsDOMNode(mElement);
|
||||
prefetchService->PrefetchURI(uri,
|
||||
mElement->OwnerDoc()->GetDocumentURI(),
|
||||
domNode, linkTypes & nsStyleLinkElement::ePREFETCH);
|
||||
if (linkTypes & nsStyleLinkElement::ePRELOAD) {
|
||||
nsContentPolicyType policyType;
|
||||
bool isPreloadValid = CheckPreloadAttrs(policyType, mElement);
|
||||
if (!isPreloadValid) {
|
||||
// XXX: WPTs expect that we timeout on invalid preloads including
|
||||
// those with valid destinations instead of firing an error event.
|
||||
return;
|
||||
}
|
||||
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
|
||||
} else {
|
||||
prefetchService->PrefetchURI(uri,
|
||||
mElement->OwnerDoc()->GetDocumentURI(),
|
||||
domNode,
|
||||
linkTypes & nsStyleLinkElement::ePREFETCH);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -125,6 +187,95 @@ Link::TryDNSPrefetchPreconnectOrPrefetch()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Link::UpdatePreload(nsIAtom* aName,
|
||||
const nsAttrValue* aValue,
|
||||
const nsAttrValue* aOldValue)
|
||||
{
|
||||
MOZ_ASSERT(mElement->IsInComposedDoc());
|
||||
|
||||
if (!ElementHasHref()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoString rel;
|
||||
if (!mElement->GetAttr(kNameSpaceID_None, nsGkAtoms::rel, rel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!nsContentUtils::PrefetchEnabled(mElement->OwnerDoc()->GetDocShell()) ||
|
||||
!nsContentUtils::IsPreloadEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t linkTypes = nsStyleLinkElement::ParseLinkTypes(rel,
|
||||
mElement->NodePrincipal());
|
||||
|
||||
if (!(linkTypes & nsStyleLinkElement::ePRELOAD)) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> uri(GetURI());
|
||||
if (!uri) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNode> domNode = GetAsDOMNode(mElement);
|
||||
|
||||
nsContentPolicyType policyType;
|
||||
bool isPreloadValid = CheckPreloadAttrs(policyType, mElement);
|
||||
if (!isPreloadValid) {
|
||||
// XXX: WPTs expect that we timeout on invalid preloads including
|
||||
// those with valid destinations instead of firing an error event.
|
||||
return;
|
||||
}
|
||||
|
||||
if (aName == nsGkAtoms::crossorigin) {
|
||||
CORSMode corsMode = Element::AttrValueToCORSMode(aValue);
|
||||
CORSMode oldCorsMode = Element::AttrValueToCORSMode(aOldValue);
|
||||
if (corsMode != oldCorsMode) {
|
||||
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoString oldValue;
|
||||
if (aOldValue) {
|
||||
aOldValue->ToString(oldValue);
|
||||
} else {
|
||||
oldValue = EmptyString();
|
||||
}
|
||||
nsContentPolicyType oldPolicyType = nsIContentPolicy::TYPE_INVALID;
|
||||
|
||||
if (aName == nsGkAtoms::as) {
|
||||
if (aOldValue) {
|
||||
CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement);
|
||||
}
|
||||
} else if (aName == nsGkAtoms::type) {
|
||||
if (CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement)) {
|
||||
oldPolicyType = policyType;
|
||||
} else {
|
||||
oldPolicyType = nsIContentPolicy::TYPE_INVALID;
|
||||
}
|
||||
} else if (aName == nsGkAtoms::media) {
|
||||
if (CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement)) {
|
||||
oldPolicyType = policyType;
|
||||
} else {
|
||||
oldPolicyType = nsIContentPolicy::TYPE_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
// Return early for invalid preloads since we shouldn't trigger a new fetch.
|
||||
if (policyType == nsIContentPolicy::TYPE_INVALID) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fire the associated event if the policy type has changed.
|
||||
if (policyType != oldPolicyType) {
|
||||
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Link::CancelPrefetch()
|
||||
{
|
||||
@@ -635,6 +786,156 @@ Link::SetHrefAttribute(nsIURI *aURI)
|
||||
NS_ConvertUTF8toUTF16(href), true);
|
||||
}
|
||||
|
||||
bool
|
||||
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
|
||||
const nsAString& aDestination,
|
||||
const nsAString& aType,
|
||||
const nsAString& aMedia,
|
||||
nsIDocument* aDocument)
|
||||
{
|
||||
nsString mimeType;
|
||||
nsString params;
|
||||
nsContentUtils::SplitMimeType(aType, mimeType, params);
|
||||
ToLowerCase(mimeType);
|
||||
|
||||
nsAttrValue destinationAttr;
|
||||
ParseDestinationValue(aDestination, destinationAttr);
|
||||
|
||||
aPolicyType = DestinationToContentPolicy(destinationAttr);
|
||||
if (aPolicyType == nsIContentPolicy::TYPE_INVALID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if media attribute is valid.
|
||||
if (!aMedia.IsEmpty()) {
|
||||
nsCSSParser cssParser;
|
||||
RefPtr<nsMediaList> mediaList = new nsMediaList();
|
||||
cssParser.ParseMediaList(aMedia, nullptr, 0, mediaList, false);
|
||||
|
||||
nsIPresShell* shell = aDocument->GetShell();
|
||||
if (!shell) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsPresContext* presContext = shell->GetPresContext();
|
||||
if (!presContext) {
|
||||
return false;
|
||||
}
|
||||
if (!mediaList->Matches(presContext, nullptr)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (mimeType.IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (aPolicyType) {
|
||||
case nsIContentPolicy::TYPE_OTHER:
|
||||
if (destinationAttr.GetEnumValue() == DESTINATION_JSON) {
|
||||
return nsContentUtils::IsJSONMIMEType(mimeType);
|
||||
}
|
||||
return true;
|
||||
case nsIContentPolicy::TYPE_MEDIA:
|
||||
if (destinationAttr.GetEnumValue() == DESTINATION_TRACK) {
|
||||
return mimeType.EqualsASCII(TEXT_VTT);
|
||||
}
|
||||
return DecoderTraits::IsSupportedInVideoDocument(NS_ConvertUTF16toUTF8(mimeType));
|
||||
case nsIContentPolicy::TYPE_FONT:
|
||||
return nsContentUtils::IsFontMIMEType(mimeType);
|
||||
case nsIContentPolicy::TYPE_IMAGE:
|
||||
return imgLoader::SupportImageWithMimeType(NS_ConvertUTF16toUTF8(mimeType).get(),
|
||||
AcceptedMimeTypes::IMAGES_AND_DOCUMENTS);
|
||||
case nsIContentPolicy::TYPE_SCRIPT:
|
||||
return nsContentUtils::IsJavascriptMIMEType(mimeType);
|
||||
case nsIContentPolicy::TYPE_STYLESHEET:
|
||||
return mimeType.EqualsASCII(TEXT_CSS);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
|
||||
nsIAtom* aName,
|
||||
const nsAString& aValue,
|
||||
Element* aElement)
|
||||
{
|
||||
nsAutoString destination;
|
||||
if (aName == nsGkAtoms::as) {
|
||||
destination = aValue;
|
||||
} else {
|
||||
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::as, destination);
|
||||
}
|
||||
|
||||
nsAutoString type;
|
||||
if (aName == nsGkAtoms::type) {
|
||||
type = aValue;
|
||||
} else {
|
||||
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
|
||||
}
|
||||
|
||||
nsAutoString media;
|
||||
if (aName == nsGkAtoms::media) {
|
||||
media = aValue;
|
||||
} else {
|
||||
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::media, media);
|
||||
}
|
||||
|
||||
return CheckPreloadAttrs(aPolicyType,
|
||||
destination,
|
||||
type,
|
||||
media,
|
||||
aElement->OwnerDoc());
|
||||
}
|
||||
|
||||
bool
|
||||
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
|
||||
Element* aElement)
|
||||
{
|
||||
nsAutoString unused;
|
||||
return CheckPreloadAttrs(aPolicyType,
|
||||
nullptr,
|
||||
unused,
|
||||
aElement);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
Link::ParseDestinationValue(const nsAString& aValue,
|
||||
nsAttrValue& aResult)
|
||||
{
|
||||
// Invalid values are treated as an empty string.
|
||||
aResult.ParseEnumValue(aValue,
|
||||
kDestinationAttributeTable,
|
||||
false,
|
||||
&kDestinationAttributeTable[0]);
|
||||
}
|
||||
|
||||
/* static */ nsContentPolicyType
|
||||
Link::DestinationToContentPolicy(const nsAttrValue& aValue)
|
||||
{
|
||||
switch (aValue.GetEnumValue()) {
|
||||
case DESTINATION_AUDIO:
|
||||
case DESTINATION_TRACK:
|
||||
case DESTINATION_VIDEO:
|
||||
return nsIContentPolicy::TYPE_MEDIA;
|
||||
case DESTINATION_FONT:
|
||||
return nsIContentPolicy::TYPE_FONT;
|
||||
case DESTINATION_IMAGE:
|
||||
return nsIContentPolicy::TYPE_IMAGE;
|
||||
case DESTINATION_SCRIPT:
|
||||
return nsIContentPolicy::TYPE_SCRIPT;
|
||||
case DESTINATION_STYLE:
|
||||
return nsIContentPolicy::TYPE_STYLESHEET;
|
||||
case DESTINATION_JSON:
|
||||
case DESTINATION_FETCH:
|
||||
return nsIContentPolicy::TYPE_OTHER;
|
||||
case DESTINATION_INVALID:
|
||||
default:
|
||||
return nsIContentPolicy::TYPE_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
size_t
|
||||
Link::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
|
||||
+18
-1
@@ -116,9 +116,26 @@ public:
|
||||
nsWrapperCache::FlagsType aRequestedFlag);
|
||||
|
||||
// This is called by HTMLLinkElement.
|
||||
void TryDNSPrefetchPreconnectOrPrefetch();
|
||||
void TrySpeculativeLoadFeature();
|
||||
void UpdatePreload(nsIAtom* aName,
|
||||
const nsAttrValue* aValue,
|
||||
const nsAttrValue* aOldValue);
|
||||
void CancelPrefetch();
|
||||
|
||||
static void ParseDestinationValue(const nsAString& aValue, nsAttrValue& aResult);
|
||||
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
|
||||
Element* aElement);
|
||||
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
|
||||
nsIAtom* aName,
|
||||
const nsAString& aValue,
|
||||
Element* aElement);
|
||||
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
|
||||
const nsAString& aAs,
|
||||
const nsAString& aType,
|
||||
const nsAString& aMedia,
|
||||
nsIDocument* aDocument);
|
||||
static nsContentPolicyType DestinationToContentPolicy(const nsAttrValue& aValue);
|
||||
|
||||
protected:
|
||||
virtual ~Link();
|
||||
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
|
||||
#include "Navigator.h"
|
||||
#include "nsIXULAppInfo.h"
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
#include "nsPluginArray.h"
|
||||
#endif
|
||||
#include "nsMimeTypeArray.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/BodyExtractor.h"
|
||||
@@ -30,6 +32,7 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/Clipboard.h"
|
||||
#ifdef MOZ_GAMEPAD
|
||||
#include "mozilla/dom/GamepadServiceTest.h"
|
||||
#endif
|
||||
@@ -178,7 +181,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMimeTypes)
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlugins)
|
||||
#endif
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPermissions)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
|
||||
@@ -209,10 +214,12 @@ Navigator::Invalidate()
|
||||
|
||||
mMimeTypes = nullptr;
|
||||
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
if (mPlugins) {
|
||||
mPlugins->Invalidate();
|
||||
mPlugins = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
mPermissions = nullptr;
|
||||
|
||||
@@ -488,6 +495,7 @@ Navigator::GetMimeTypes(ErrorResult& aRv)
|
||||
return mMimeTypes;
|
||||
}
|
||||
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
nsPluginArray*
|
||||
Navigator::GetPlugins(ErrorResult& aRv)
|
||||
{
|
||||
@@ -502,6 +510,7 @@ Navigator::GetPlugins(ErrorResult& aRv)
|
||||
|
||||
return mPlugins;
|
||||
}
|
||||
#endif
|
||||
|
||||
Permissions*
|
||||
Navigator::GetPermissions(ErrorResult& aRv)
|
||||
@@ -662,6 +671,18 @@ Navigator::CpuHasSSE2()
|
||||
return mozilla::supports_sse2();
|
||||
}
|
||||
|
||||
bool
|
||||
Navigator::CpuHasAVX()
|
||||
{
|
||||
return mozilla::supports_avx();
|
||||
}
|
||||
|
||||
bool
|
||||
Navigator::CpuHasAVX2()
|
||||
{
|
||||
return mozilla::supports_avx2();
|
||||
}
|
||||
|
||||
void
|
||||
Navigator::RefreshMIMEArray()
|
||||
{
|
||||
@@ -1489,5 +1510,14 @@ Navigator::GetUserAgent(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
|
||||
return siteSpecificUA->GetUserAgentForURIAndWindow(aURI, aWindow, aUserAgent);
|
||||
}
|
||||
|
||||
Clipboard*
|
||||
Navigator::Clipboard()
|
||||
{
|
||||
if (!mClipboard) {
|
||||
mClipboard = new dom::Clipboard(GetWindow());
|
||||
}
|
||||
return mClipboard;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
@@ -19,7 +19,9 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsWeakPtr.h"
|
||||
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
class nsPluginArray;
|
||||
#endif
|
||||
class nsMimeTypeArray;
|
||||
class nsPIDOMWindowInner;
|
||||
class nsIDOMNavigatorSystemMessages;
|
||||
@@ -37,6 +39,7 @@ class WakeLock;
|
||||
class ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams;
|
||||
class ServiceWorkerContainer;
|
||||
class DOMRequest;
|
||||
class Clipboard;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -126,7 +129,9 @@ public:
|
||||
void RegisterContentHandler(const nsAString& aMIMEType, const nsAString& aURL,
|
||||
const nsAString& aTitle, ErrorResult& aRv);
|
||||
nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv);
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
nsPluginArray* GetPlugins(ErrorResult& aRv);
|
||||
#endif
|
||||
Permissions* GetPermissions(ErrorResult& aRv);
|
||||
bool GlobalPrivacyControl();
|
||||
Geolocation* GetGeolocation(ErrorResult& aRv);
|
||||
@@ -169,6 +174,8 @@ public:
|
||||
bool JavaEnabled(ErrorResult& aRv);
|
||||
uint64_t HardwareConcurrency();
|
||||
bool CpuHasSSE2();
|
||||
bool CpuHasAVX();
|
||||
bool CpuHasAVX2();
|
||||
bool TaintEnabled()
|
||||
{
|
||||
return false;
|
||||
@@ -210,6 +217,8 @@ public:
|
||||
ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<ServiceWorkerContainer> ServiceWorker();
|
||||
|
||||
dom::Clipboard* Clipboard();
|
||||
|
||||
void GetLanguages(nsTArray<nsString>& aLanguages);
|
||||
|
||||
@@ -257,12 +266,15 @@ private:
|
||||
ErrorResult& aRv);
|
||||
|
||||
RefPtr<nsMimeTypeArray> mMimeTypes;
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
RefPtr<nsPluginArray> mPlugins;
|
||||
#endif
|
||||
RefPtr<Permissions> mPermissions;
|
||||
RefPtr<Geolocation> mGeolocation;
|
||||
RefPtr<DesktopNotificationCenter> mNotification;
|
||||
RefPtr<PowerManager> mPowerManager;
|
||||
RefPtr<network::Connection> mConnection;
|
||||
RefPtr<dom::Clipboard> mClipboard;
|
||||
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
|
||||
RefPtr<system::AudioChannelManager> mAudioChannelManager;
|
||||
#endif
|
||||
|
||||
@@ -109,9 +109,8 @@ ShadowRoot::CloneInternalDataFrom(ShadowRoot* aOther)
|
||||
for (size_t i = 0; i < sheetCount; ++i) {
|
||||
StyleSheet* sheet = aOther->SheetAt(i);
|
||||
if (sheet && sheet->IsApplicable()) {
|
||||
// TODO: Remove AsGecko() call once Stylo is removed.
|
||||
RefPtr<CSSStyleSheet> clonedSheet =
|
||||
sheet->AsGecko()->Clone(nullptr, nullptr, nullptr, nullptr);
|
||||
sheet->AsConcrete()->Clone(nullptr, nullptr, nullptr, nullptr);
|
||||
if (clonedSheet) {
|
||||
AppendStyleSheet(*clonedSheet);
|
||||
}
|
||||
|
||||
+10
-4
@@ -2548,16 +2548,22 @@ WebSocket::Close(const Optional<uint16_t>& aCode,
|
||||
return;
|
||||
}
|
||||
|
||||
// If the webSocket is not closed we MUST have a mImpl.
|
||||
MOZ_ASSERT(mImpl);
|
||||
// If we don't have mImpl, we are in a shutting down worker where we are still
|
||||
// in CONNECTING state, but already disconnected internally.
|
||||
if (!mImpl) {
|
||||
MOZ_ASSERT(readyState == CONNECTING);
|
||||
SetReadyState(CLOSING);
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<WebSocketImpl> impl = mImpl;
|
||||
if (readyState == CONNECTING) {
|
||||
mImpl->FailConnection(closeCode, closeReason);
|
||||
impl->FailConnection(closeCode, closeReason);
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(readyState == OPEN);
|
||||
mImpl->CloseConnection(closeCode, closeReason);
|
||||
impl->CloseConnection(closeCode, closeReason);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -43,9 +43,7 @@ ShouldExposeChildWindow(nsString& aNameBeingResolved, nsPIDOMWindowOuter* aChild
|
||||
//
|
||||
// This is problematic because it allows possibly-malicious and unrelated
|
||||
// cross-origin subframes to pollute the global namespace of their parent in
|
||||
// unpredictable ways (see bug 860494). This is also problematic for browser
|
||||
// engines like Servo that want to run cross-origin script on different
|
||||
// threads.
|
||||
// unpredictable ways (see bug 860494).
|
||||
//
|
||||
// The naive solution here would be to filter out any cross-origin subframes
|
||||
// obtained when doing named lookup in global scope. But that is unlikely to
|
||||
|
||||
+4
-3
@@ -394,10 +394,11 @@ SOURCES += [
|
||||
'nsImageLoadingContent.cpp',
|
||||
# Because of OS X headers.
|
||||
'nsObjectLoadingContent.cpp',
|
||||
# nsPluginArray.cpp includes npapi.h indirectly, and that includes a lot of system headers
|
||||
'nsPluginArray.cpp',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_ENABLE_NPAPI']:
|
||||
SOURCES += ['nsPluginArray.cpp']
|
||||
|
||||
# Are we targeting x86-32 or x86-64? If so, we want to include SSE2 code for
|
||||
# nsTextFragment.cpp
|
||||
if CONFIG['INTEL_ARCHITECTURE']:
|
||||
@@ -464,7 +465,7 @@ include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
if CONFIG['MOZ_PHOENIX']:
|
||||
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_XULRUNNER']:
|
||||
DEFINES['HAVE_SIDEBAR'] = True
|
||||
|
||||
if CONFIG['MOZ_X11']:
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
#include "nsIAtom.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/ServoBindingTypes.h"
|
||||
#include "mozilla/DeclarationBlockInlines.h"
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "prprf.h"
|
||||
@@ -150,7 +149,7 @@ nsAttrValue::nsAttrValue(nsIAtom* aValue)
|
||||
SetTo(aValue);
|
||||
}
|
||||
|
||||
nsAttrValue::nsAttrValue(already_AddRefed<DeclarationBlock> aValue,
|
||||
nsAttrValue::nsAttrValue(already_AddRefed<css::Declaration> aValue,
|
||||
const nsAString* aSerialized)
|
||||
: mBits(0)
|
||||
{
|
||||
@@ -420,7 +419,7 @@ nsAttrValue::SetTo(double aValue, const nsAString* aSerialized)
|
||||
}
|
||||
|
||||
void
|
||||
nsAttrValue::SetTo(already_AddRefed<DeclarationBlock> aValue,
|
||||
nsAttrValue::SetTo(already_AddRefed<css::Declaration> aValue,
|
||||
const nsAString* aSerialized)
|
||||
{
|
||||
MiscContainer* cont = EnsureEmptyMiscContainer();
|
||||
@@ -643,7 +642,7 @@ nsAttrValue::ToString(nsAString& aResult) const
|
||||
{
|
||||
aResult.Truncate();
|
||||
MiscContainer *container = GetMiscContainer();
|
||||
if (DeclarationBlock* decl = container->mValue.mCSSDeclaration) {
|
||||
if (css::Declaration* decl = container->mValue.mCSSDeclaration) {
|
||||
decl->ToString(aResult);
|
||||
}
|
||||
const_cast<nsAttrValue*>(this)->SetMiscAtomOrString(&aResult);
|
||||
@@ -1748,15 +1747,11 @@ nsAttrValue::ParseStyleAttribute(const nsAString& aString,
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<DeclarationBlock> decl;
|
||||
if (ownerDoc->GetStyleBackendType() == StyleBackendType::Servo) {
|
||||
decl = ServoDeclarationBlock::FromCssText(aString);
|
||||
} else {
|
||||
css::Loader* cssLoader = ownerDoc->CSSLoader();
|
||||
nsCSSParser cssParser(cssLoader);
|
||||
decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI,
|
||||
aElement->NodePrincipal());
|
||||
}
|
||||
RefPtr<css::Declaration> decl;
|
||||
css::Loader* cssLoader = ownerDoc->CSSLoader();
|
||||
nsCSSParser cssParser(cssLoader);
|
||||
decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI,
|
||||
aElement->NodePrincipal());
|
||||
if (!decl) {
|
||||
return false;
|
||||
}
|
||||
@@ -1988,8 +1983,6 @@ nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
if (Type() == eCSSDeclaration && container->mValue.mCSSDeclaration) {
|
||||
// TODO: mCSSDeclaration might be owned by another object which
|
||||
// would make us count them twice, bug 677493.
|
||||
// Bug 1281964: For ServoDeclarationBlock if we do measure we'll
|
||||
// need a way to call the Servo heap_size_of function.
|
||||
//n += container->mCSSDeclaration->SizeOfIncludingThis(aMallocSizeOf);
|
||||
} else if (Type() == eAtomArray && container->mValue.mAtomArray) {
|
||||
// Don't measure each nsIAtom, they are measured separatly.
|
||||
|
||||
@@ -36,8 +36,8 @@ class nsStyledElement;
|
||||
struct MiscContainer;
|
||||
|
||||
namespace mozilla {
|
||||
class DeclarationBlock;
|
||||
namespace css {
|
||||
class Declaration;
|
||||
struct URLValue;
|
||||
struct ImageValue;
|
||||
} // namespace css
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
nsAttrValue(const nsAttrValue& aOther);
|
||||
explicit nsAttrValue(const nsAString& aValue);
|
||||
explicit nsAttrValue(nsIAtom* aValue);
|
||||
nsAttrValue(already_AddRefed<mozilla::DeclarationBlock> aValue,
|
||||
nsAttrValue(already_AddRefed<mozilla::css::Declaration> aValue,
|
||||
const nsAString* aSerialized);
|
||||
explicit nsAttrValue(const nsIntMargin& aValue);
|
||||
~nsAttrValue();
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
void SetTo(int16_t aInt);
|
||||
void SetTo(int32_t aInt, const nsAString* aSerialized);
|
||||
void SetTo(double aValue, const nsAString* aSerialized);
|
||||
void SetTo(already_AddRefed<mozilla::DeclarationBlock> aValue,
|
||||
void SetTo(already_AddRefed<mozilla::css::Declaration> aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(mozilla::css::URLValue* aValue, const nsAString* aSerialized);
|
||||
void SetTo(const nsIntMargin& aValue);
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
inline int16_t GetEnumValue() const;
|
||||
inline float GetPercentValue() const;
|
||||
inline AtomArray* GetAtomArrayValue() const;
|
||||
inline mozilla::DeclarationBlock* GetCSSDeclarationValue() const;
|
||||
inline mozilla::css::Declaration* GetCSSDeclarationValue() const;
|
||||
inline mozilla::css::URLValue* GetURLValue() const;
|
||||
inline mozilla::css::ImageValue* GetImageValue() const;
|
||||
inline double GetDoubleValue() const;
|
||||
|
||||
@@ -30,7 +30,7 @@ struct MiscContainer final
|
||||
nscolor mColor;
|
||||
uint32_t mEnumValue;
|
||||
int32_t mPercent;
|
||||
mozilla::DeclarationBlock* mCSSDeclaration;
|
||||
mozilla::css::Declaration* mCSSDeclaration;
|
||||
mozilla::css::URLValue* mURL;
|
||||
mozilla::css::ImageValue* mImage;
|
||||
nsAttrValue::AtomArray* mAtomArray;
|
||||
@@ -145,7 +145,7 @@ nsAttrValue::GetAtomArrayValue() const
|
||||
return GetMiscContainer()->mValue.mAtomArray;
|
||||
}
|
||||
|
||||
inline mozilla::DeclarationBlock*
|
||||
inline mozilla::css::Declaration*
|
||||
nsAttrValue::GetCSSDeclarationValue() const
|
||||
{
|
||||
NS_PRECONDITION(Type() == eCSSDeclaration, "wrong type");
|
||||
|
||||
@@ -84,8 +84,7 @@ private:
|
||||
nsIContent **outImageOrLinkNode,
|
||||
bool* outDragSelectedText);
|
||||
static already_AddRefed<nsIContent> FindParentLinkNode(nsIContent* inNode);
|
||||
static [[nodiscard]] nsresult
|
||||
GetAnchorURL(nsIContent* inNode, nsAString& outURL);
|
||||
[[nodiscard]] static nsresult GetAnchorURL(nsIContent* inNode, nsAString& outURL);
|
||||
static void GetNodeString(nsIContent* inNode, nsAString & outNodeString);
|
||||
static void CreateLinkText(const nsAString& inURL, const nsAString & inText,
|
||||
nsAString& outLinkText);
|
||||
|
||||
@@ -135,6 +135,7 @@ NS_CP_ContentTypeName(uint32_t contentType)
|
||||
CASE_RETURN( TYPE_INTERNAL_STYLESHEET );
|
||||
CASE_RETURN( TYPE_INTERNAL_STYLESHEET_PRELOAD );
|
||||
CASE_RETURN( TYPE_SAVEAS_DOWNLOAD );
|
||||
CASE_RETURN( TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS );
|
||||
default:
|
||||
return "<Unknown Type>";
|
||||
}
|
||||
|
||||
+57
-16
@@ -48,6 +48,7 @@
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/dom/Link.h"
|
||||
#include "nsParserConstants.h"
|
||||
#include "nsSandboxFlags.h"
|
||||
|
||||
@@ -100,6 +101,7 @@ nsContentSink::nsContentSink()
|
||||
, mDeferredFlushTags(0)
|
||||
, mIsDocumentObserver(0)
|
||||
, mRunsToCompletion(0)
|
||||
, mIsBlockingOnload(false)
|
||||
, mDeflectedCount(0)
|
||||
, mHasPendingEvent(false)
|
||||
, mCurrentParseEndTime(0)
|
||||
@@ -470,6 +472,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
|
||||
nsAutoString media;
|
||||
nsAutoString anchor;
|
||||
nsAutoString crossOrigin;
|
||||
nsAutoString destination;
|
||||
|
||||
crossOrigin.SetIsVoid(true);
|
||||
|
||||
@@ -652,6 +655,11 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
|
||||
crossOrigin = value;
|
||||
crossOrigin.StripWhitespace();
|
||||
}
|
||||
} else if (attr.LowerCaseEqualsLiteral("as")) {
|
||||
if (destination.IsEmpty()) {
|
||||
destination = value;
|
||||
destination.StripWhitespace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -665,7 +673,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
|
||||
rv = ProcessLink(anchor, href, rel,
|
||||
// prefer RFC 5987 variant over non-I18zed version
|
||||
titleStar.IsEmpty() ? title : titleStar,
|
||||
type, media, crossOrigin);
|
||||
type, media, crossOrigin, destination);
|
||||
}
|
||||
|
||||
href.Truncate();
|
||||
@@ -675,6 +683,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
|
||||
media.Truncate();
|
||||
anchor.Truncate();
|
||||
crossOrigin.SetIsVoid(true);
|
||||
destination.Truncate();
|
||||
|
||||
seenParameters = false;
|
||||
}
|
||||
@@ -687,7 +696,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
|
||||
rv = ProcessLink(anchor, href, rel,
|
||||
// prefer RFC 5987 variant over non-I18zed version
|
||||
titleStar.IsEmpty() ? title : titleStar,
|
||||
type, media, crossOrigin);
|
||||
type, media, crossOrigin, destination);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@@ -698,7 +707,8 @@ nsresult
|
||||
nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
|
||||
const nsSubstring& aRel, const nsSubstring& aTitle,
|
||||
const nsSubstring& aType, const nsSubstring& aMedia,
|
||||
const nsSubstring& aCrossOrigin)
|
||||
const nsSubstring& aCrossOrigin,
|
||||
const nsSubstring& aDestination)
|
||||
{
|
||||
uint32_t linkTypes =
|
||||
nsStyleLinkElement::ParseLinkTypes(aRel, mDocument->NodePrincipal());
|
||||
@@ -715,18 +725,21 @@ nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool hasPrefetch = linkTypes & nsStyleLinkElement::ePREFETCH;
|
||||
// prefetch href if relation is "next" or "prefetch"
|
||||
if (hasPrefetch || (linkTypes & nsStyleLinkElement::eNEXT)) {
|
||||
PrefetchHref(aHref, mDocument, hasPrefetch);
|
||||
if ((linkTypes & nsStyleLinkElement::eNEXT) ||
|
||||
(linkTypes & nsStyleLinkElement::ePREFETCH) ||
|
||||
(linkTypes & nsStyleLinkElement::ePRELOAD)) {
|
||||
PrefetchOrPreloadHref(aHref, mDocument, linkTypes, aDestination, aType, aMedia);
|
||||
}
|
||||
|
||||
if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::eDNS_PREFETCH)) {
|
||||
PrefetchDNS(aHref);
|
||||
}
|
||||
if (!aHref.IsEmpty()) {
|
||||
if (linkTypes & nsStyleLinkElement::eDNS_PREFETCH) {
|
||||
PrefetchDNS(aHref);
|
||||
}
|
||||
|
||||
if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::ePRECONNECT)) {
|
||||
Preconnect(aHref, aCrossOrigin);
|
||||
if (linkTypes & nsStyleLinkElement::ePRECONNECT) {
|
||||
Preconnect(aHref, aCrossOrigin);
|
||||
}
|
||||
}
|
||||
|
||||
// is it a stylesheet link?
|
||||
@@ -846,9 +859,12 @@ nsContentSink::ProcessMETATag(nsIContent* aContent)
|
||||
|
||||
|
||||
void
|
||||
nsContentSink::PrefetchHref(const nsAString &aHref,
|
||||
nsINode *aSource,
|
||||
bool aExplicit)
|
||||
nsContentSink::PrefetchOrPreloadHref(const nsAString &aHref,
|
||||
nsINode *aSource,
|
||||
uint32_t aLinkTypes,
|
||||
const nsAString& aDestination,
|
||||
const nsAString& aType,
|
||||
const nsAString& aMedia)
|
||||
{
|
||||
nsCOMPtr<nsIPrefetchService> prefetchService(do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
|
||||
if (prefetchService) {
|
||||
@@ -860,7 +876,25 @@ nsContentSink::PrefetchHref(const nsAString &aHref,
|
||||
mDocument->GetDocBaseURI());
|
||||
if (uri) {
|
||||
nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(aSource);
|
||||
prefetchService->PrefetchURI(uri, mDocumentURI, domNode, aExplicit);
|
||||
if (aLinkTypes & nsStyleLinkElement::ePRELOAD) {
|
||||
nsContentPolicyType policyType;
|
||||
bool isPreloadValid = Link::CheckPreloadAttrs(policyType,
|
||||
aDestination,
|
||||
aType,
|
||||
aMedia,
|
||||
mDocument);
|
||||
if (!isPreloadValid) {
|
||||
// XXX: WPTs expect that we timeout on invalid preloads including
|
||||
// those with valid destinations instead of firing an error event.
|
||||
return;
|
||||
}
|
||||
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
|
||||
} else {
|
||||
prefetchService->PrefetchURI(uri,
|
||||
mDocumentURI,
|
||||
domNode,
|
||||
aLinkTypes & nsStyleLinkElement::ePREFETCH);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1539,8 +1573,14 @@ nsContentSink::DropParserAndPerfHint(void)
|
||||
FavorPerformanceHint(true, 0);
|
||||
}
|
||||
|
||||
if (!mRunsToCompletion) {
|
||||
// Call UnblockOnload only if mRunsToComletion is false and if
|
||||
// we have already started loading because it's possible that this function
|
||||
// is called (i.e. the parser is terminated) before we start loading due to
|
||||
// destroying the window inside unload event callbacks for the previous
|
||||
// document.
|
||||
if (!mRunsToCompletion && mIsBlockingOnload) {
|
||||
mDocument->UnblockOnload(true);
|
||||
mIsBlockingOnload = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1595,6 +1635,7 @@ nsContentSink::WillBuildModelImpl()
|
||||
{
|
||||
if (!mRunsToCompletion) {
|
||||
mDocument->BlockOnload();
|
||||
mIsBlockingOnload = true;
|
||||
|
||||
mBeginLoadTime = PR_IntervalToMicroseconds(PR_IntervalNow());
|
||||
}
|
||||
|
||||
@@ -153,7 +153,8 @@ protected:
|
||||
nsresult ProcessLink(const nsSubstring& aAnchor,
|
||||
const nsSubstring& aHref, const nsSubstring& aRel,
|
||||
const nsSubstring& aTitle, const nsSubstring& aType,
|
||||
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin);
|
||||
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin,
|
||||
const nsSubstring& aDestination);
|
||||
|
||||
virtual nsresult ProcessStyleLink(nsIContent* aElement,
|
||||
const nsSubstring& aHref,
|
||||
@@ -162,8 +163,12 @@ protected:
|
||||
const nsSubstring& aType,
|
||||
const nsSubstring& aMedia);
|
||||
|
||||
void PrefetchHref(const nsAString &aHref, nsINode *aSource,
|
||||
bool aExplicit);
|
||||
void PrefetchOrPreloadHref(const nsAString &aHref,
|
||||
nsINode *aSource,
|
||||
uint32_t aLinkTypes,
|
||||
const nsAString& aDestination,
|
||||
const nsAString& aType,
|
||||
const nsAString& aMedia);
|
||||
|
||||
// For PrefetchDNS() aHref can either be the usual
|
||||
// URI format or of the form "//www.hostname.com" without a scheme.
|
||||
@@ -304,6 +309,8 @@ protected:
|
||||
// True if this is parser is a fragment parser or an HTML DOMParser.
|
||||
// XML DOMParser leaves this to false for now!
|
||||
uint8_t mRunsToCompletion : 1;
|
||||
// True if we are blocking load event.
|
||||
bool mIsBlockingOnload : 1;
|
||||
|
||||
//
|
||||
// -- Can interrupt parsing members --
|
||||
|
||||
+214
-36
@@ -23,7 +23,9 @@
|
||||
#include "Layers.h"
|
||||
#include "MediaDecoder.h"
|
||||
// nsNPAPIPluginInstance must be included before nsIDocument.h, which is included in mozAutoDocUpdate.h.
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
#include "nsNPAPIPluginInstance.h"
|
||||
#endif
|
||||
#include "gfxDrawable.h"
|
||||
#include "gfxPrefs.h"
|
||||
#include "ImageOps.h"
|
||||
@@ -216,6 +218,7 @@
|
||||
#include "TabChild.h"
|
||||
#include "mozilla/dom/DocGroup.h"
|
||||
#include "mozilla/dom/TabGroup.h"
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
|
||||
#include "nsIBidiKeyboard.h"
|
||||
|
||||
@@ -294,6 +297,7 @@ bool nsContentUtils::sGettersDecodeURLHash = false;
|
||||
bool nsContentUtils::sPrivacyResistFingerprinting = false;
|
||||
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
||||
bool nsContentUtils::sUseActivityCursor = false;
|
||||
bool nsContentUtils::sPreloadEnabled = true;
|
||||
|
||||
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
|
||||
|
||||
@@ -632,6 +636,9 @@ nsContentUtils::Init()
|
||||
Preferences::AddBoolVarCache(&sUseActivityCursor,
|
||||
"ui.use_activity_cursor", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sPreloadEnabled,
|
||||
"network.preload", true);
|
||||
|
||||
Element::InitCCCallbacks();
|
||||
|
||||
nsCOMPtr<nsIUUIDGenerator> uuidGenerator =
|
||||
@@ -733,20 +740,40 @@ nsContentUtils::InitializeModifierStrings()
|
||||
sModifierSeparator = new nsString(modifierSeparator);
|
||||
}
|
||||
|
||||
mozilla::EventClassID
|
||||
nsContentUtils::GetEventClassIDFromMessage(EventMessage aEventMessage)
|
||||
{
|
||||
switch (aEventMessage) {
|
||||
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
|
||||
case message_: return struct_;
|
||||
#include "mozilla/EventNameList.h"
|
||||
#undef MESSAGE_TO_EVENT
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Invalid event message?");
|
||||
return eBasicEventClass;
|
||||
}
|
||||
}
|
||||
|
||||
static nsIAtom*
|
||||
GetEventTypeFromMessage(EventMessage aEventMessage)
|
||||
{
|
||||
switch (aEventMessage) {
|
||||
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
|
||||
case message_: return nsGkAtoms::on##name_;
|
||||
#include "mozilla/EventNameList.h"
|
||||
#undef MESSAGE_TO_EVENT
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Because of SVG/SMIL we have several atoms mapped to the same
|
||||
// id, but we can rely on MESSAGE_TO_EVENT to map id to only one atom.
|
||||
static bool
|
||||
ShouldAddEventToStringEventTable(const EventNameMapping& aMapping)
|
||||
{
|
||||
switch(aMapping.mMessage) {
|
||||
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
|
||||
case message_: return nsGkAtoms::on##name_ == aMapping.mAtom;
|
||||
#include "mozilla/EventNameList.h"
|
||||
#undef MESSAGE_TO_EVENT
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
MOZ_ASSERT(aMapping.mAtom);
|
||||
return GetEventTypeFromMessage(aMapping.mMessage) == aMapping.mAtom;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -2395,34 +2422,35 @@ nsContentUtils::GetCommonAncestor(nsIDOMNode *aNode,
|
||||
return CallQueryInterface(common, aCommonAncestor);
|
||||
}
|
||||
|
||||
// static
|
||||
nsINode*
|
||||
nsContentUtils::GetCommonAncestor(nsINode* aNode1,
|
||||
nsINode* aNode2)
|
||||
template <typename Node, typename GetParentFunc>
|
||||
static Node*
|
||||
GetCommonAncestorInternal(Node* aNode1,
|
||||
Node* aNode2,
|
||||
GetParentFunc aGetParentFunc)
|
||||
{
|
||||
if (aNode1 == aNode2) {
|
||||
return aNode1;
|
||||
}
|
||||
|
||||
// Build the chain of parents
|
||||
AutoTArray<nsINode*, 30> parents1, parents2;
|
||||
AutoTArray<Node*, 30> parents1, parents2;
|
||||
do {
|
||||
parents1.AppendElement(aNode1);
|
||||
aNode1 = aNode1->GetParentNode();
|
||||
aNode1 = aGetParentFunc(aNode1);
|
||||
} while (aNode1);
|
||||
do {
|
||||
parents2.AppendElement(aNode2);
|
||||
aNode2 = aNode2->GetParentNode();
|
||||
aNode2 = aGetParentFunc(aNode2);
|
||||
} while (aNode2);
|
||||
|
||||
// Find where the parent chain differs
|
||||
uint32_t pos1 = parents1.Length();
|
||||
uint32_t pos2 = parents2.Length();
|
||||
nsINode* parent = nullptr;
|
||||
Node* parent = nullptr;
|
||||
uint32_t len;
|
||||
for (len = std::min(pos1, pos2); len > 0; --len) {
|
||||
nsINode* child1 = parents1.ElementAt(--pos1);
|
||||
nsINode* child2 = parents2.ElementAt(--pos2);
|
||||
Node* child1 = parents1.ElementAt(--pos1);
|
||||
Node* child2 = parents2.ElementAt(--pos2);
|
||||
if (child1 != child2) {
|
||||
break;
|
||||
}
|
||||
@@ -2432,6 +2460,25 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1,
|
||||
return parent;
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsINode*
|
||||
nsContentUtils::GetCommonAncestor(nsINode* aNode1, nsINode* aNode2)
|
||||
{
|
||||
return GetCommonAncestorInternal(aNode1, aNode2, [](nsINode* aNode) {
|
||||
return aNode->GetParentNode();
|
||||
});
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsIContent*
|
||||
nsContentUtils::GetCommonFlattenedTreeAncestor(nsIContent* aContent1,
|
||||
nsIContent* aContent2)
|
||||
{
|
||||
return GetCommonAncestorInternal(aContent1, aContent2, [](nsIContent* aContent) {
|
||||
return aContent->GetFlattenedTreeParent();
|
||||
});
|
||||
}
|
||||
|
||||
// static
|
||||
nsINode*
|
||||
nsContentUtils::GetCommonAncestorUnderInteractiveContent(nsINode* aNode1,
|
||||
@@ -4100,12 +4147,36 @@ nsresult GetEventAndTarget(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsContentUtils::DispatchEventForPreloadURI(nsIDOMNode* aNode,
|
||||
nsContentPolicyType& aPolicyType)
|
||||
{
|
||||
if (!IsPreloadEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINode> domNode = do_QueryInterface(aNode);
|
||||
if (domNode && domNode->IsInComposedDoc()) {
|
||||
bool success = aPolicyType != nsIContentPolicy::TYPE_INVALID;
|
||||
RefPtr<AsyncEventDispatcher> asyncDispatcher =
|
||||
new AsyncEventDispatcher(domNode,
|
||||
success ?
|
||||
NS_LITERAL_STRING("load") :
|
||||
NS_LITERAL_STRING("error"),
|
||||
/* aCanBubble = */ false,
|
||||
/* aCancelable = */ false);
|
||||
asyncDispatcher->RunDOMEventWhenSafe();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
const nsAString& aEventName,
|
||||
bool aCanBubble, bool aCancelable,
|
||||
bool *aDefaultAction)
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool* aDefaultAction)
|
||||
{
|
||||
return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
|
||||
true, aDefaultAction);
|
||||
@@ -4113,10 +4184,12 @@ nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
const nsAString& aEventName,
|
||||
bool aCanBubble, bool aCancelable,
|
||||
bool *aDefaultAction)
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool* aDefaultAction)
|
||||
{
|
||||
return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
|
||||
false, aDefaultAction);
|
||||
@@ -4124,10 +4197,13 @@ nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsContentUtils::DispatchEvent(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
nsContentUtils::DispatchEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
const nsAString& aEventName,
|
||||
bool aCanBubble, bool aCancelable,
|
||||
bool aTrusted, bool *aDefaultAction,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool aTrusted,
|
||||
bool* aDefaultAction,
|
||||
bool aOnlyChromeDispatch)
|
||||
{
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
@@ -4142,12 +4218,50 @@ nsContentUtils::DispatchEvent(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
return target->DispatchEvent(event, aDefaultAction ? aDefaultAction : &dummy);
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsContentUtils::DispatchEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
WidgetEvent& aEvent,
|
||||
EventMessage aEventMessage,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool aTrusted,
|
||||
bool* aDefaultAction,
|
||||
bool aOnlyChromeDispatch)
|
||||
{
|
||||
MOZ_ASSERT_IF(aOnlyChromeDispatch, aTrusted);
|
||||
|
||||
nsCOMPtr<EventTarget> target(do_QueryInterface(aTarget));
|
||||
|
||||
aEvent.mTime = PR_Now();
|
||||
|
||||
aEvent.mSpecifiedEventType = GetEventTypeFromMessage(aEventMessage);
|
||||
aEvent.SetDefaultComposed();
|
||||
aEvent.SetDefaultComposedInNativeAnonymousContent();
|
||||
|
||||
aEvent.mFlags.mBubbles = aCanBubble;
|
||||
aEvent.mFlags.mCancelable = aCancelable;
|
||||
aEvent.mFlags.mOnlyChromeDispatch = aOnlyChromeDispatch;
|
||||
|
||||
aEvent.mTarget = target;
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsresult rv = EventDispatcher::DispatchDOMEvent(target, &aEvent, nullptr,
|
||||
nullptr, &status);
|
||||
if (aDefaultAction) {
|
||||
*aDefaultAction = (status != nsEventStatus_eConsumeNoDefault);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContentUtils::DispatchChromeEvent(nsIDocument *aDoc,
|
||||
nsISupports *aTarget,
|
||||
const nsAString& aEventName,
|
||||
bool aCanBubble, bool aCancelable,
|
||||
bool *aDefaultAction)
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool* aDefaultAction)
|
||||
{
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
@@ -5418,10 +5532,18 @@ nsContentUtils::RunInStableState(already_AddRefed<nsIRunnable> aRunnable)
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsContentUtils::RunInMetastableState(already_AddRefed<nsIRunnable> aRunnable)
|
||||
nsContentUtils::AddPendingIDBTransaction(already_AddRefed<nsIRunnable> aTransaction)
|
||||
{
|
||||
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
|
||||
CycleCollectedJSContext::Get()->RunInMetastableState(Move(aRunnable));
|
||||
CycleCollectedJSContext::Get()->AddPendingIDBTransaction(Move(aTransaction));
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool
|
||||
nsContentUtils::IsInStableOrMetaStableState()
|
||||
{
|
||||
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
|
||||
return CycleCollectedJSContext::Get()->IsInStableOrMetaStableState();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6470,9 +6592,16 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
|
||||
contentViewer->GetPreviousViewer(getter_AddRefs(zombieViewer));
|
||||
|
||||
// If there are 2 viewers for the current docshell, that
|
||||
// means the current document is a zombie document.
|
||||
// Only navigate into the subdocument if it's not a zombie.
|
||||
return !zombieViewer;
|
||||
// means the current document may be a zombie document.
|
||||
// While load and pageshow events are dispatched, zombie viewer is the old,
|
||||
// to be hidden document.
|
||||
if (zombieViewer) {
|
||||
bool inOnLoad = false;
|
||||
docShell->GetIsExecutingOnLoadHandler(&inOnLoad);
|
||||
return inOnLoad;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -6943,7 +7072,7 @@ nsContentUtils::HaveEqualPrincipals(nsIDocument* aDoc1, nsIDocument* aDoc2)
|
||||
bool
|
||||
nsContentUtils::HasPluginWithUncontrolledEventDispatch(nsIContent* aContent)
|
||||
{
|
||||
#ifdef XP_MACOSX
|
||||
#if defined(XP_MACOSX) || !defined(MOZ_ENABLE_NPAPI)
|
||||
// We control dispatch to all mac plugins.
|
||||
return false;
|
||||
#else
|
||||
@@ -7340,6 +7469,12 @@ nsContentUtils::GPCEnabled()
|
||||
return nsContentUtils::sGPCEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::IsPreloadEnabled()
|
||||
{
|
||||
return nsContentUtils::sPreloadEnabled;
|
||||
}
|
||||
|
||||
mozilla::LogModule*
|
||||
nsContentUtils::DOMDumpLog()
|
||||
{
|
||||
@@ -7404,6 +7539,48 @@ nsContentUtils::IsJavascriptMIMEType(const nsAString& aMIMEType)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::IsJSONMIMEType(const nsAString& aMIMEType)
|
||||
{
|
||||
static const char* jsonTypes[] = {
|
||||
"text/json",
|
||||
"application/json",
|
||||
"application/geo+json",
|
||||
nullptr
|
||||
};
|
||||
|
||||
for (uint32_t i = 0; jsonTypes[i]; ++i) {
|
||||
if (aMIMEType.LowerCaseEqualsASCII(jsonTypes[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::IsFontMIMEType(const nsAString& aMIMEType)
|
||||
{
|
||||
// The following list was taken from IANA and excludes deprecated mime-types:
|
||||
// https://www.iana.org/assignments/media-types/media-types.xhtml#font
|
||||
static const char* fontTypes[] = {
|
||||
"font/otf",
|
||||
"font/sfnt",
|
||||
"font/ttf",
|
||||
"font/woff",
|
||||
"font/woff2",
|
||||
nullptr
|
||||
};
|
||||
|
||||
for (uint32_t i = 0; fontTypes[i]; ++i) {
|
||||
if (aMIMEType.LowerCaseEqualsASCII(fontTypes[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContentUtils::GenerateUUIDInPlace(nsID& aUUID)
|
||||
{
|
||||
@@ -8586,6 +8763,7 @@ nsContentUtils::InternalContentPolicyTypeToExternal(nsContentPolicyType aType)
|
||||
case nsIContentPolicy::TYPE_INTERNAL_WORKER:
|
||||
case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
|
||||
case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER:
|
||||
case nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS:
|
||||
return nsIContentPolicy::TYPE_SCRIPT;
|
||||
|
||||
case nsIContentPolicy::TYPE_INTERNAL_EMBED:
|
||||
|
||||
+108
-14
@@ -19,6 +19,7 @@
|
||||
#include "js/TypeDecls.h"
|
||||
#include "js/Value.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/GuardObjects.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
@@ -333,12 +334,18 @@ public:
|
||||
nsIDOMNode** aCommonAncestor);
|
||||
|
||||
/**
|
||||
* Returns the common ancestor, if any, for two nodes. Returns null if the
|
||||
* nodes are disconnected.
|
||||
* Returns the common ancestor, if any, for two nodes.
|
||||
* Returns null if the nodes are disconnected.
|
||||
*/
|
||||
static nsINode* GetCommonAncestor(nsINode* aNode1,
|
||||
nsINode* aNode2);
|
||||
static nsINode* GetCommonAncestor(nsINode* aNode1, nsINode* aNode2);
|
||||
|
||||
/**
|
||||
* Returns the common flattened tree ancestor, if any, for two given content
|
||||
* nodes.
|
||||
*/
|
||||
static nsIContent* GetCommonFlattenedTreeAncestor(nsIContent* aContent1,
|
||||
nsIContent* aContent2);
|
||||
|
||||
/**
|
||||
* Returns the common ancestor under interactive content, if any.
|
||||
* If neither one has interactive content as ancestor, common ancestor will be
|
||||
@@ -1172,6 +1179,16 @@ public:
|
||||
static void MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent,
|
||||
nsIDocument* aOwnerDoc);
|
||||
|
||||
|
||||
/**
|
||||
* This method creates and dispatches either a "load" or "error" event
|
||||
* to the provided node (a preload link).
|
||||
* @param aNode The node to fire the event at.
|
||||
* @param aPolicyType The resulting content policy from the preload.
|
||||
*/
|
||||
static void DispatchEventForPreloadURI(nsIDOMNode* aNode,
|
||||
nsContentPolicyType& aPolicyType);
|
||||
|
||||
/**
|
||||
* This method creates and dispatches a trusted event.
|
||||
* Works only with events which can be created by calling
|
||||
@@ -1192,6 +1209,33 @@ public:
|
||||
bool aCancelable,
|
||||
bool *aDefaultAction = nullptr);
|
||||
|
||||
/**
|
||||
* This method creates and dispatches a trusted event using an event message.
|
||||
* @param aDoc The document which will be used to create the event.
|
||||
* @param aTarget The target of the event, should be QIable to
|
||||
* EventTarget.
|
||||
* @param aEventMessage The event message.
|
||||
* @param aCanBubble Whether the event can bubble.
|
||||
* @param aCancelable Is the event cancelable.
|
||||
* @param aDefaultAction Set to true if default action should be taken,
|
||||
* see nsIDOMEventTarget::DispatchEvent.
|
||||
*/
|
||||
template <class WidgetEventType>
|
||||
static nsresult DispatchTrustedEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
mozilla::EventMessage aEventMessage,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool *aDefaultAction = nullptr,
|
||||
bool aOnlyChromeDispatch = false)
|
||||
{
|
||||
WidgetEventType event(true, aEventMessage);
|
||||
MOZ_ASSERT(GetEventClassIDFromMessage(aEventMessage) == event.mClass);
|
||||
return DispatchEvent(aDoc, aTarget, event, aEventMessage,
|
||||
aCanBubble, aCancelable, true,
|
||||
aDefaultAction, aOnlyChromeDispatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method creates and dispatches a untrusted event.
|
||||
* Works only with events which can be created by calling
|
||||
@@ -1212,6 +1256,33 @@ public:
|
||||
bool aCancelable,
|
||||
bool *aDefaultAction = nullptr);
|
||||
|
||||
/**
|
||||
* This method creates and dispatches a untrusted event using an event message.
|
||||
* @param aDoc The document which will be used to create the event.
|
||||
* @param aTarget The target of the event, should be QIable to
|
||||
* EventTarget.
|
||||
* @param aEventMessage The event message.
|
||||
* @param aCanBubble Whether the event can bubble.
|
||||
* @param aCancelable Is the event cancelable.
|
||||
* @param aDefaultAction Set to true if default action should be taken,
|
||||
* see nsIDOMEventTarget::DispatchEvent.
|
||||
*/
|
||||
template <class WidgetEventType>
|
||||
static nsresult DispatchUntrustedEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
mozilla::EventMessage aEventMessage,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool *aDefaultAction = nullptr,
|
||||
bool aOnlyChromeDispatch = false)
|
||||
{
|
||||
WidgetEventType event(false, aEventMessage);
|
||||
MOZ_ASSERT(GetEventClassIDFromMessage(aEventMessage) == event.mClass);
|
||||
return DispatchEvent(aDoc, aTarget, event, aEventMessage,
|
||||
aCanBubble, aCancelable, false,
|
||||
aDefaultAction, aOnlyChromeDispatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method creates and dispatches a trusted event to the chrome
|
||||
* event handler (the parent object of the DOM Window in the event target
|
||||
@@ -1767,17 +1838,17 @@ public:
|
||||
*/
|
||||
static void RunInStableState(already_AddRefed<nsIRunnable> aRunnable);
|
||||
|
||||
/* Add a "synchronous section", in the form of an nsIRunnable run once the
|
||||
* event loop has reached a "metastable state". |aRunnable| must not cause any
|
||||
* queued events to be processed (i.e. must not spin the event loop).
|
||||
* We've reached a metastable state when the currently executing task or
|
||||
* microtask has finished. This is not specced at this time.
|
||||
* In practice this runs aRunnable once the currently executing task or
|
||||
* microtask finishes. If called multiple times per microtask, all the
|
||||
* runnables will be executed, in the order in which RunInMetastableState()
|
||||
* was called
|
||||
/* Add a pending IDBTransaction to be cleaned up at the end of performing a
|
||||
* microtask checkpoint.
|
||||
* See the step of "Cleanup Indexed Database Transactions" in
|
||||
* https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint
|
||||
*/
|
||||
static void RunInMetastableState(already_AddRefed<nsIRunnable> aRunnable);
|
||||
static void AddPendingIDBTransaction(already_AddRefed<nsIRunnable> aTransaction);
|
||||
|
||||
/**
|
||||
* Returns true if we are doing StableState/MetastableState.
|
||||
*/
|
||||
static bool IsInStableOrMetaStableState();
|
||||
|
||||
/* Process viewport META data. This gives us information for the scale
|
||||
* and zoom of a page on mobile devices. We stick the information in
|
||||
@@ -2134,6 +2205,11 @@ public:
|
||||
return sUseActivityCursor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the preload service is enabled.
|
||||
*/
|
||||
static bool IsPreloadEnabled();
|
||||
|
||||
/**
|
||||
* Return true if this doc is controlled by a ServiceWorker.
|
||||
*/
|
||||
@@ -2378,6 +2454,10 @@ public:
|
||||
|
||||
static bool IsJavascriptMIMEType(const nsAString& aMIMEType);
|
||||
|
||||
static bool IsJSONMIMEType(const nsAString& aMIMEType);
|
||||
|
||||
static bool IsFontMIMEType(const nsAString& aMIMEType);
|
||||
|
||||
static void SplitMimeType(const nsAString& aValue, nsString& aType,
|
||||
nsString& aParams);
|
||||
|
||||
@@ -2859,6 +2939,16 @@ private:
|
||||
bool *aDefaultAction = nullptr,
|
||||
bool aOnlyChromeDispatch = false);
|
||||
|
||||
static nsresult DispatchEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
mozilla::WidgetEvent& aWidgetEvent,
|
||||
mozilla::EventMessage aEventMessage,
|
||||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool aTrusted,
|
||||
bool *aDefaultAction = nullptr,
|
||||
bool aOnlyChromeDispatch = false);
|
||||
|
||||
static void InitializeModifierStrings();
|
||||
|
||||
static void DropFragmentParsers();
|
||||
@@ -2870,6 +2960,9 @@ private:
|
||||
static void* AllocClassMatchingInfo(nsINode* aRootNode,
|
||||
const nsString* aClasses);
|
||||
|
||||
static mozilla::EventClassID
|
||||
GetEventClassIDFromMessage(mozilla::EventMessage aEventMessage);
|
||||
|
||||
// Fills in aInfo with the tokens from the supplied autocomplete attribute.
|
||||
static AutocompleteAttrState InternalSerializeAutocompleteAttribute(const nsAttrValue* aAttrVal,
|
||||
mozilla::dom::AutocompleteInfo& aInfo);
|
||||
@@ -2950,6 +3043,7 @@ private:
|
||||
static bool sPrivacyResistFingerprinting;
|
||||
static bool sSendPerformanceTimingNotifications;
|
||||
static bool sUseActivityCursor;
|
||||
static bool sPreloadEnabled;
|
||||
static uint32_t sCookiesLifetimePolicy;
|
||||
static uint32_t sCookiesBehavior;
|
||||
|
||||
|
||||
@@ -67,21 +67,10 @@
|
||||
#include "nsIDOMEventTarget.h"
|
||||
|
||||
// CSS related includes
|
||||
#include "nsCSSRules.h"
|
||||
#include "nsIDOMCSSRule.h"
|
||||
#include "nsMemory.h"
|
||||
|
||||
// includes needed for the prototype chain interfaces
|
||||
#include "nsIDOMCSSKeyframeRule.h"
|
||||
#include "nsIDOMCSSKeyframesRule.h"
|
||||
#include "nsIDOMCSSImportRule.h"
|
||||
#include "nsIDOMCSSMediaRule.h"
|
||||
#include "nsIDOMCSSFontFaceRule.h"
|
||||
#include "nsIDOMCSSMozDocumentRule.h"
|
||||
#include "nsIDOMCSSSupportsRule.h"
|
||||
#include "nsIDOMCSSCounterStyleRule.h"
|
||||
#include "nsIDOMCSSPageRule.h"
|
||||
#include "nsIDOMCSSStyleRule.h"
|
||||
#include "nsIDOMXULCommandDispatcher.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsITreeSelection.h"
|
||||
@@ -186,16 +175,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
|
||||
// Misc Core related classes
|
||||
|
||||
// CSS classes
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSNameSpaceRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
// XUL classes
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULCommandDispatcher, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
@@ -212,15 +191,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULTreeBuilder, nsDOMGenericSH,
|
||||
DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSMozDocumentRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager,
|
||||
nsMessageManagerSH<nsEventTargetSH>,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
@@ -236,21 +206,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ChromeMessageSender, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSKeyframeRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSKeyframesRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSCounterStyleRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSPageRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
|
||||
@@ -503,22 +458,6 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSStyleRule, nsIDOMCSSStyleRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSImportRule, nsIDOMCSSImportRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSImportRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSMediaRule, nsIDOMCSSMediaRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMediaRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSNameSpaceRule, nsIDOMCSSRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(XULCommandDispatcher, nsIDOMXULCommandDispatcher)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandDispatcher)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
@@ -546,18 +485,6 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsITreeView)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSMozDocumentRule, nsIDOMCSSMozDocumentRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMozDocumentRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSSupportsRule, nsIDOMCSSSupportsRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)
|
||||
@@ -589,26 +516,6 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframeRule, nsIDOMCSSKeyframeRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframeRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframesRule, nsIDOMCSSKeyframesRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframesRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSCounterStyleRule, nsIDOMCSSCounterStyleRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSPageRule, nsIDOMCSSPageRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSPageRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSFontFeatureValuesRule, nsIDOMCSSFontFeatureValuesRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
DOMCI_CLASS(DOMPrototype)
|
||||
DOMCI_CLASS(DOMConstructor)
|
||||
|
||||
// CSS classes
|
||||
DOMCI_CLASS(CSSStyleRule)
|
||||
DOMCI_CLASS(CSSImportRule)
|
||||
DOMCI_CLASS(CSSMediaRule)
|
||||
DOMCI_CLASS(CSSNameSpaceRule)
|
||||
|
||||
// XUL classes
|
||||
DOMCI_CLASS(XULCommandDispatcher)
|
||||
DOMCI_CLASS(XULControllers)
|
||||
@@ -21,27 +15,11 @@ DOMCI_CLASS(TreeContentView)
|
||||
DOMCI_CLASS(XULTemplateBuilder)
|
||||
DOMCI_CLASS(XULTreeBuilder)
|
||||
|
||||
DOMCI_CLASS(CSSMozDocumentRule)
|
||||
DOMCI_CLASS(CSSSupportsRule)
|
||||
|
||||
// @font-face in CSS
|
||||
DOMCI_CLASS(CSSFontFaceRule)
|
||||
|
||||
DOMCI_CLASS(ContentFrameMessageManager)
|
||||
DOMCI_CLASS(ContentProcessMessageManager)
|
||||
DOMCI_CLASS(ChromeMessageBroadcaster)
|
||||
DOMCI_CLASS(ChromeMessageSender)
|
||||
|
||||
DOMCI_CLASS(CSSKeyframeRule)
|
||||
DOMCI_CLASS(CSSKeyframesRule)
|
||||
|
||||
// @counter-style in CSS
|
||||
DOMCI_CLASS(CSSCounterStyleRule)
|
||||
|
||||
DOMCI_CLASS(CSSPageRule)
|
||||
|
||||
DOMCI_CLASS(CSSFontFeatureValuesRule)
|
||||
|
||||
DOMCI_CLASS(XULControlElement)
|
||||
DOMCI_CLASS(XULLabeledControlElement)
|
||||
DOMCI_CLASS(XULButtonElement)
|
||||
|
||||
@@ -623,7 +623,7 @@ nsDOMMutationObserver::QueueMutationObserverMicroTask()
|
||||
|
||||
RefPtr<MutationObserverMicroTask> momt =
|
||||
new MutationObserverMicroTask();
|
||||
ccjs->DispatchMicroTaskRunnable(momt.forget());
|
||||
ccjs->DispatchToMicroTask(momt.forget());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -644,9 +644,8 @@ nsDOMMutationObserver::RescheduleForRun()
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<MutationObserverMicroTask> momt =
|
||||
new MutationObserverMicroTask();
|
||||
ccjs->DispatchMicroTaskRunnable(momt.forget());
|
||||
RefPtr<MutationObserverMicroTask> momt = new MutationObserverMicroTask();
|
||||
ccjs->DispatchToMicroTask(momt.forget());
|
||||
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,6 @@ public:
|
||||
|
||||
inline DOMHighResTimeStamp TimeStampToDOMHighRes(mozilla::TimeStamp aStamp) const
|
||||
{
|
||||
MOZ_ASSERT(!aStamp.IsNull(), "The timestamp should not be null");
|
||||
if (aStamp.IsNull()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3145,9 +3145,11 @@ nsDOMWindowUtils::GetPaintingSuppressed(bool *aPaintingSuppressed)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetPlugins(JSContext* cx, JS::MutableHandle<JS::Value> aPlugins)
|
||||
{
|
||||
#ifdef MOZ_ENABLE_NPAPI
|
||||
nsCOMPtr<nsIDocument> doc = GetDocument();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
||||
@@ -3159,6 +3161,7 @@ nsDOMWindowUtils::GetPlugins(JSContext* cx, JS::MutableHandle<JS::Value> aPlugin
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
aPlugins.setObject(*jsPlugins);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 2899 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user