OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return instance; | 53 return instance; |
54 } | 54 } |
55 | 55 |
56 bool ContextFeatures::dialogElementEnabled(Document* document) | 56 bool ContextFeatures::dialogElementEnabled(Document* document) |
57 { | 57 { |
58 if (!document) | 58 if (!document) |
59 return RuntimeEnabledFeatures::dialogElementEnabled(); | 59 return RuntimeEnabledFeatures::dialogElementEnabled(); |
60 return document->contextFeatures().isEnabled(document, DialogElement, Runtim
eEnabledFeatures::dialogElementEnabled()); | 60 return document->contextFeatures().isEnabled(document, DialogElement, Runtim
eEnabledFeatures::dialogElementEnabled()); |
61 } | 61 } |
62 | 62 |
| 63 bool ContextFeatures::styleScopedEnabled(Document* document) |
| 64 { |
| 65 if (!document) |
| 66 return RuntimeEnabledFeatures::styleScopedEnabled(); |
| 67 return document->contextFeatures().isEnabled(document, StyleScoped, RuntimeE
nabledFeatures::styleScopedEnabled()); |
| 68 } |
| 69 |
63 bool ContextFeatures::pagePopupEnabled(Document* document) | 70 bool ContextFeatures::pagePopupEnabled(Document* document) |
64 { | 71 { |
65 if (!document) | 72 if (!document) |
66 return false; | 73 return false; |
67 return document->contextFeatures().isEnabled(document, PagePopup, false); | 74 return document->contextFeatures().isEnabled(document, PagePopup, false); |
68 } | 75 } |
69 | 76 |
70 bool ContextFeatures::mutationEventsEnabled(Document* document) | 77 bool ContextFeatures::mutationEventsEnabled(Document* document) |
71 { | 78 { |
72 ASSERT(document); | 79 ASSERT(document); |
(...skipping 14 matching lines...) Expand all Loading... |
87 | 94 |
88 void provideContextFeaturesToDocumentFrom(Document& document, Page& page) | 95 void provideContextFeaturesToDocumentFrom(Document& document, Page& page) |
89 { | 96 { |
90 ContextFeatures* provided = static_cast<ContextFeatures*>(ContextFeatures::S
upplementType::from(page, ContextFeatures::supplementName())); | 97 ContextFeatures* provided = static_cast<ContextFeatures*>(ContextFeatures::S
upplementType::from(page, ContextFeatures::supplementName())); |
91 if (!provided) | 98 if (!provided) |
92 return; | 99 return; |
93 document.setContextFeatures(*provided); | 100 document.setContextFeatures(*provided); |
94 } | 101 } |
95 | 102 |
96 } | 103 } |
OLD | NEW |