| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) | 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) |
| 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 4 * Copyright (C) 2004-2006 Apple Computer, Inc. | 4 * Copyright (C) 2004-2006 Apple Computer, Inc. |
| 5 * Copyright (C) 2006 James G. Speth (speth@end.com) | 5 * Copyright (C) 2006 James G. Speth (speth@end.com) |
| 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) | 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) |
| 7 * Copyright 2007, 2008 Google Inc. All Rights Reserved. | 7 * Copyright 2007, 2008 Google Inc. All Rights Reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
| (...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1632 } | 1632 } |
| 1633 | 1633 |
| 1634 RefPtr<Attr> result = imp->setAttributeNodeNS(newAttr, ec); | 1634 RefPtr<Attr> result = imp->setAttributeNodeNS(newAttr, ec); |
| 1635 if (ec != 0) { | 1635 if (ec != 0) { |
| 1636 V8Proxy::SetDOMException(ec); | 1636 V8Proxy::SetDOMException(ec); |
| 1637 return v8::Handle<v8::Value>(); | 1637 return v8::Handle<v8::Value>(); |
| 1638 } | 1638 } |
| 1639 return V8Proxy::NodeToV8Object(result.get()); | 1639 return V8Proxy::NodeToV8Object(result.get()); |
| 1640 } | 1640 } |
| 1641 | 1641 |
| 1642 // Location -------------------------------------------------------------------- | |
| 1643 | 1642 |
| 1644 CALLBACK_FUNC_DECL(LocationValueOf) { | |
| 1645 // Just return the this object the way the normal valueOf function | |
| 1646 // on the Object prototype would. The valueOf function is only | |
| 1647 // added to make sure that it cannot be overwritten on location | |
| 1648 // objects, since that would provide a hook to change the string | |
| 1649 // conversion behavior of location objects. | |
| 1650 return args.This(); | |
| 1651 } | |
| 1652 | 1643 |
| 1653 // Attr ------------------------------------------------------------------------ | 1644 // Attr ------------------------------------------------------------------------ |
| 1654 | 1645 |
| 1655 ACCESSOR_SETTER(AttrValue) { | 1646 ACCESSOR_SETTER(AttrValue) { |
| 1656 Attr* imp = | 1647 Attr* imp = |
| 1657 V8Proxy::DOMWrapperToNode<Attr>(info.Holder()); | 1648 V8Proxy::DOMWrapperToNode<Attr>(info.Holder()); |
| 1658 String v = valueToStringWithNullCheck(value); | 1649 String v = valueToStringWithNullCheck(value); |
| 1659 Element* ownerElement = imp->ownerElement(); | 1650 Element* ownerElement = imp->ownerElement(); |
| 1660 | 1651 |
| 1661 if (ownerElement && | 1652 if (ownerElement && |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2381 | 2372 |
| 2382 NAMED_ACCESS_CHECK(History) { | 2373 NAMED_ACCESS_CHECK(History) { |
| 2383 ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::HISTORY); | 2374 ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::HISTORY); |
| 2384 // Only allow same origin access | 2375 // Only allow same origin access |
| 2385 History* imp = | 2376 History* imp = |
| 2386 V8Proxy::ToNativeObject<History>(V8ClassIndex::HISTORY, host); | 2377 V8Proxy::ToNativeObject<History>(V8ClassIndex::HISTORY, host); |
| 2387 return V8Proxy::CanAccessFrame(imp->frame(), false); | 2378 return V8Proxy::CanAccessFrame(imp->frame(), false); |
| 2388 } | 2379 } |
| 2389 | 2380 |
| 2390 | 2381 |
| 2391 INDEXED_ACCESS_CHECK(Location) { | |
| 2392 ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::LOCATION); | |
| 2393 // Only allow same origin access | |
| 2394 Location* imp = | |
| 2395 V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, host); | |
| 2396 return V8Proxy::CanAccessFrame(imp->frame(), false); | |
| 2397 } | |
| 2398 | |
| 2399 | |
| 2400 NAMED_ACCESS_CHECK(Location) { | |
| 2401 ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::LOCATION); | |
| 2402 // Only allow same origin access | |
| 2403 Location* imp = | |
| 2404 V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, host); | |
| 2405 return V8Proxy::CanAccessFrame(imp->frame(), false); | |
| 2406 } | |
| 2407 | |
| 2408 | 2382 |
| 2409 #undef INDEXED_ACCESS_CHECK | 2383 #undef INDEXED_ACCESS_CHECK |
| 2410 #undef NAMED_ACCESS_CHECK | 2384 #undef NAMED_ACCESS_CHECK |
| 2411 #undef NAMED_PROPERTY_GETTER | 2385 #undef NAMED_PROPERTY_GETTER |
| 2412 #undef NAMED_PROPERTY_SETTER | 2386 #undef NAMED_PROPERTY_SETTER |
| 2413 | 2387 |
| 2414 | 2388 |
| 2415 // static | 2389 // static |
| 2416 Frame* V8Custom::GetTargetFrame(v8::Local<v8::Object> host, | 2390 Frame* V8Custom::GetTargetFrame(v8::Local<v8::Object> host, |
| 2417 v8::Local<v8::Value> data) { | 2391 v8::Local<v8::Value> data) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 #undef MAKE_CASE | 2455 #undef MAKE_CASE |
| 2482 | 2456 |
| 2483 default: | 2457 default: |
| 2484 return V8ClassIndex::INVALID_CLASS_INDEX; | 2458 return V8ClassIndex::INVALID_CLASS_INDEX; |
| 2485 } | 2459 } |
| 2486 } | 2460 } |
| 2487 | 2461 |
| 2488 #endif // ENABLE(SVG) | 2462 #endif // ENABLE(SVG) |
| 2489 | 2463 |
| 2490 } // namespace WebCore | 2464 } // namespace WebCore |
| OLD | NEW |