| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 return toLayoutPart(layoutObject)->widget(); | 347 return toLayoutPart(layoutObject)->widget(); |
| 348 } | 348 } |
| 349 | 349 |
| 350 static bool acceptsEditingFocus(const Element& element) | 350 static bool acceptsEditingFocus(const Element& element) |
| 351 { | 351 { |
| 352 DCHECK(element.hasEditableStyle()); | 352 DCHECK(element.hasEditableStyle()); |
| 353 | 353 |
| 354 return element.document().frame() && element.rootEditableElement(); | 354 return element.document().frame() && element.rootEditableElement(); |
| 355 } | 355 } |
| 356 | 356 |
| 357 static bool isOriginPotentiallyTrustworthy(SecurityOrigin* origin, String* error
Message) | |
| 358 { | |
| 359 if (origin->isPotentiallyTrustworthy()) | |
| 360 return true; | |
| 361 if (errorMessage) | |
| 362 *errorMessage = origin->isPotentiallyTrustworthyErrorMessage(); | |
| 363 return false; | |
| 364 } | |
| 365 | |
| 366 uint64_t Document::s_globalTreeVersion = 0; | 357 uint64_t Document::s_globalTreeVersion = 0; |
| 367 | 358 |
| 368 static bool s_threadedParsingEnabledForTesting = true; | 359 static bool s_threadedParsingEnabledForTesting = true; |
| 369 | 360 |
| 370 using WeakDocumentSet = PersistentHeapHashSet<WeakMember<Document>>; | 361 using WeakDocumentSet = PersistentHeapHashSet<WeakMember<Document>>; |
| 371 | 362 |
| 372 static WeakDocumentSet& liveDocumentSet() | 363 static WeakDocumentSet& liveDocumentSet() |
| 373 { | 364 { |
| 374 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, ()); | 365 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, ()); |
| 375 return set; | 366 return set; |
| (...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3343 // Additionally, with | 3334 // Additionally, with |
| 3344 // <iframe src="scheme-has-exception://host"> | 3335 // <iframe src="scheme-has-exception://host"> |
| 3345 // <iframe src="http://host"></iframe> | 3336 // <iframe src="http://host"></iframe> |
| 3346 // <iframe sandbox src="http://host"></iframe> | 3337 // <iframe sandbox src="http://host"></iframe> |
| 3347 // </iframe> | 3338 // </iframe> |
| 3348 // both inner iframes would fail the check, even though the outermost iframe | 3339 // both inner iframes would fail the check, even though the outermost iframe |
| 3349 // passes. | 3340 // passes. |
| 3350 // | 3341 // |
| 3351 // In all cases, a frame must be potentially trustworthy in addition to | 3342 // In all cases, a frame must be potentially trustworthy in addition to |
| 3352 // having an exception listed in order for the exception to be granted. | 3343 // having an exception listed in order for the exception to be granted. |
| 3353 if (!isOriginPotentiallyTrustworthy(getSecurityOrigin(), errorMessage)) | 3344 if (!getSecurityOrigin()->isPotentiallyTrustworthy()) { |
| 3345 if (errorMessage) |
| 3346 *errorMessage = SecurityOrigin::isPotentiallyTrustworthyErrorMessage
(); |
| 3354 return false; | 3347 return false; |
| 3348 } |
| 3355 | 3349 |
| 3356 if (SchemeRegistry::schemeShouldBypassSecureContextCheck(getSecurityOrigin()
->protocol())) | 3350 if (SchemeRegistry::schemeShouldBypassSecureContextCheck(getSecurityOrigin()
->protocol())) |
| 3357 return true; | 3351 return true; |
| 3358 | 3352 |
| 3359 if (privilegeContextCheck == StandardSecureContextCheck) { | 3353 if (privilegeContextCheck == StandardSecureContextCheck) { |
| 3360 if (!m_frame) | 3354 Frame* parent = m_frame ? m_frame->tree().parent() : nullptr; |
| 3361 return true; | 3355 if (parent && !parent->canHaveSecureChild()) { |
| 3362 Frame* parent = m_frame->tree().parent(); | 3356 if (errorMessage) |
| 3363 while (parent) { | 3357 *errorMessage = SecurityOrigin::isPotentiallyTrustworthyErrorMes
sage(); |
| 3364 if (!isOriginPotentiallyTrustworthy(parent->securityContext()->getSe
curityOrigin(), errorMessage)) | 3358 return false; |
| 3365 return false; | |
| 3366 parent = parent->tree().parent(); | |
| 3367 } | 3359 } |
| 3368 } | 3360 } |
| 3369 return true; | 3361 return true; |
| 3370 } | 3362 } |
| 3371 | 3363 |
| 3372 StyleSheetList& Document::styleSheets() | 3364 StyleSheetList& Document::styleSheets() |
| 3373 { | 3365 { |
| 3374 if (!m_styleSheetList) | 3366 if (!m_styleSheetList) |
| 3375 m_styleSheetList = StyleSheetList::create(this); | 3367 m_styleSheetList = StyleSheetList::create(this); |
| 3376 return *m_styleSheetList; | 3368 return *m_styleSheetList; |
| (...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5994 #ifndef NDEBUG | 5986 #ifndef NDEBUG |
| 5995 using namespace blink; | 5987 using namespace blink; |
| 5996 void showLiveDocumentInstances() | 5988 void showLiveDocumentInstances() |
| 5997 { | 5989 { |
| 5998 WeakDocumentSet& set = liveDocumentSet(); | 5990 WeakDocumentSet& set = liveDocumentSet(); |
| 5999 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5991 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6000 for (Document* document : set) | 5992 for (Document* document : set) |
| 6001 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); | 5993 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); |
| 6002 } | 5994 } |
| 6003 #endif | 5995 #endif |
| OLD | NEW |