| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // We add an extra internal field to all Document wrappers for | 252 // We add an extra internal field to all Document wrappers for |
| 253 // storing a per document DOMImplementation wrapper. | 253 // storing a per document DOMImplementation wrapper. |
| 254 // | 254 // |
| 255 // Additionally, we add two extra internal fields for | 255 // Additionally, we add two extra internal fields for |
| 256 // HTMLDocuments to implement temporary shadowing of | 256 // HTMLDocuments to implement temporary shadowing of |
| 257 // document.all. One field holds an object that is used as a | 257 // document.all. One field holds an object that is used as a |
| 258 // marker. The other field holds the marker object if | 258 // marker. The other field holds the marker object if |
| 259 // document.all is not shadowed and some other value if | 259 // document.all is not shadowed and some other value if |
| 260 // document.all is shadowed. | 260 // document.all is shadowed. |
| 261 v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTem
plate(); | 261 v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTem
plate(); |
| 262 ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapp
erInternalFieldCount); | 262 ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kNodeMinimumI
nternalFieldCount); |
| 263 instanceTemplate->SetInternalFieldCount(V8Custom::kHTMLDocumentInternalF
ieldCount); | 263 instanceTemplate->SetInternalFieldCount(V8Custom::kHTMLDocumentInternalF
ieldCount); |
| 264 break; | 264 break; |
| 265 } | 265 } |
| 266 #if ENABLE(SVG) | 266 #if ENABLE(SVG) |
| 267 case V8ClassIndex::SVGDOCUMENT: // fall through | 267 case V8ClassIndex::SVGDOCUMENT: // fall through |
| 268 #endif | 268 #endif |
| 269 case V8ClassIndex::DOCUMENT: { | 269 case V8ClassIndex::DOCUMENT: { |
| 270 // We add an extra internal field to all Document wrappers for | 270 // We add an extra internal field to all Document wrappers for |
| 271 // storing a per document DOMImplementation wrapper. | 271 // storing a per document DOMImplementation wrapper. |
| 272 v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTem
plate(); | 272 v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTem
plate(); |
| 273 ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapp
erInternalFieldCount); | 273 ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kNodeMinimumI
nternalFieldCount); |
| 274 instanceTemplate->SetInternalFieldCount( V8Custom::kDocumentMinimumInter
nalFieldCount); | 274 instanceTemplate->SetInternalFieldCount( V8Custom::kDocumentMinimumInter
nalFieldCount); |
| 275 break; | 275 break; |
| 276 } | 276 } |
| 277 case V8ClassIndex::HTMLAPPLETELEMENT: // fall through | 277 case V8ClassIndex::HTMLAPPLETELEMENT: // fall through |
| 278 case V8ClassIndex::HTMLEMBEDELEMENT: // fall through | 278 case V8ClassIndex::HTMLEMBEDELEMENT: // fall through |
| 279 case V8ClassIndex::HTMLOBJECTELEMENT: | 279 case V8ClassIndex::HTMLOBJECTELEMENT: |
| 280 // HTMLAppletElement, HTMLEmbedElement and HTMLObjectElement are | 280 // HTMLAppletElement, HTMLEmbedElement and HTMLObjectElement are |
| 281 // inherited from HTMLPlugInElement, and they share the same property | 281 // inherited from HTMLPlugInElement, and they share the same property |
| 282 // handling code. | 282 // handling code. |
| 283 descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPER
TY_GETTER(HTMLPlugInElement), USE_NAMED_PROPERTY_SETTER(HTMLPlugInElement)); | 283 descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPER
TY_GETTER(HTMLPlugInElement), USE_NAMED_PROPERTY_SETTER(HTMLPlugInElement)); |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 if (V8IsolatedWorld* world = V8IsolatedWorld::getEntered()) { | 1422 if (V8IsolatedWorld* world = V8IsolatedWorld::getEntered()) { |
| 1423 context = world->context(); | 1423 context = world->context(); |
| 1424 if (frame != V8Proxy::retrieveFrame(context)) | 1424 if (frame != V8Proxy::retrieveFrame(context)) |
| 1425 return v8::Handle<v8::Context>(); | 1425 return v8::Handle<v8::Context>(); |
| 1426 } | 1426 } |
| 1427 | 1427 |
| 1428 return context; | 1428 return context; |
| 1429 } | 1429 } |
| 1430 | 1430 |
| 1431 } // namespace WebCore | 1431 } // namespace WebCore |
| OLD | NEW |