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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 return toLayoutPart(layoutObject)->widget(); | 345 return toLayoutPart(layoutObject)->widget(); |
346 } | 346 } |
347 | 347 |
348 static bool acceptsEditingFocus(const Element& element) | 348 static bool acceptsEditingFocus(const Element& element) |
349 { | 349 { |
350 DCHECK(element.hasEditableStyle()); | 350 DCHECK(element.hasEditableStyle()); |
351 | 351 |
352 return element.document().frame() && element.rootEditableElement(); | 352 return element.document().frame() && element.rootEditableElement(); |
353 } | 353 } |
354 | 354 |
355 static bool isOriginPotentiallyTrustworthy(SecurityOrigin* origin, String* error
Message) | |
356 { | |
357 if (origin->isPotentiallyTrustworthy()) | |
358 return true; | |
359 if (errorMessage) | |
360 *errorMessage = origin->isPotentiallyTrustworthyErrorMessage(); | |
361 return false; | |
362 } | |
363 | |
364 uint64_t Document::s_globalTreeVersion = 0; | 355 uint64_t Document::s_globalTreeVersion = 0; |
365 | 356 |
366 static bool s_threadedParsingEnabledForTesting = true; | 357 static bool s_threadedParsingEnabledForTesting = true; |
367 | 358 |
368 Document::WeakDocumentSet& Document::liveDocumentSet() | 359 Document::WeakDocumentSet& Document::liveDocumentSet() |
369 { | 360 { |
370 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, (new WeakDocumentSet)); | 361 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, (new WeakDocumentSet)); |
371 return set; | 362 return set; |
372 } | 363 } |
373 | 364 |
(...skipping 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3375 // Additionally, with | 3366 // Additionally, with |
3376 // <iframe src="scheme-has-exception://host"> | 3367 // <iframe src="scheme-has-exception://host"> |
3377 // <iframe src="http://host"></iframe> | 3368 // <iframe src="http://host"></iframe> |
3378 // <iframe sandbox src="http://host"></iframe> | 3369 // <iframe sandbox src="http://host"></iframe> |
3379 // </iframe> | 3370 // </iframe> |
3380 // both inner iframes would fail the check, even though the outermost iframe | 3371 // both inner iframes would fail the check, even though the outermost iframe |
3381 // passes. | 3372 // passes. |
3382 // | 3373 // |
3383 // In all cases, a frame must be potentially trustworthy in addition to | 3374 // In all cases, a frame must be potentially trustworthy in addition to |
3384 // having an exception listed in order for the exception to be granted. | 3375 // having an exception listed in order for the exception to be granted. |
3385 if (!isOriginPotentiallyTrustworthy(getSecurityOrigin(), errorMessage)) | 3376 if (!getSecurityOrigin()->isPotentiallyTrustworthy(errorMessage)) |
3386 return false; | 3377 return false; |
3387 | 3378 |
3388 if (SchemeRegistry::schemeShouldBypassSecureContextCheck(getSecurityOrigin()
->protocol())) | 3379 if (SchemeRegistry::schemeShouldBypassSecureContextCheck(getSecurityOrigin()
->protocol())) |
3389 return true; | 3380 return true; |
3390 | 3381 |
3391 if (privilegeContextCheck == StandardSecureContextCheck) { | 3382 if (privilegeContextCheck == StandardSecureContextCheck) { |
3392 if (!m_frame) | 3383 Frame* parent = m_frame ? m_frame->tree().parent() : nullptr; |
3393 return true; | 3384 if (parent) |
3394 Frame* parent = m_frame->tree().parent(); | 3385 return parent->canHaveSecureChild(errorMessage); |
3395 while (parent) { | |
3396 if (!isOriginPotentiallyTrustworthy(parent->securityContext()->getSe
curityOrigin(), errorMessage)) | |
3397 return false; | |
3398 parent = parent->tree().parent(); | |
3399 } | |
3400 } | 3386 } |
3401 return true; | 3387 return true; |
3402 } | 3388 } |
3403 | 3389 |
3404 StyleSheetList& Document::styleSheets() | 3390 StyleSheetList& Document::styleSheets() |
3405 { | 3391 { |
3406 if (!m_styleSheetList) | 3392 if (!m_styleSheetList) |
3407 m_styleSheetList = StyleSheetList::create(this); | 3393 m_styleSheetList = StyleSheetList::create(this); |
3408 return *m_styleSheetList; | 3394 return *m_styleSheetList; |
3409 } | 3395 } |
(...skipping 2604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6014 #ifndef NDEBUG | 6000 #ifndef NDEBUG |
6015 using namespace blink; | 6001 using namespace blink; |
6016 void showLiveDocumentInstances() | 6002 void showLiveDocumentInstances() |
6017 { | 6003 { |
6018 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 6004 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
6019 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6005 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6020 for (Document* document : set) | 6006 for (Document* document : set) |
6021 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); | 6007 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); |
6022 } | 6008 } |
6023 #endif | 6009 #endif |
OLD | NEW |