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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 return; | 427 return; |
428 } | 428 } |
429 | 429 |
430 if (protocolIsJavaScript(submission->action())) { | 430 if (protocolIsJavaScript(submission->action())) { |
431 if (!document().contentSecurityPolicy()->allowFormAction(submission->act
ion())) | 431 if (!document().contentSecurityPolicy()->allowFormAction(submission->act
ion())) |
432 return; | 432 return; |
433 document().frame()->script().executeScriptIfJavaScriptURL(submission->ac
tion()); | 433 document().frame()->script().executeScriptIfJavaScriptURL(submission->ac
tion()); |
434 return; | 434 return; |
435 } | 435 } |
436 | 436 |
437 LocalFrame* targetFrame = document().frame()->loader().findFrameForNavigatio
n(submission->target(), submission->state()->sourceDocument()); | 437 Frame* targetFrame = document().frame()->findFrameForNavigation(submission->
target(), *submission->state()->sourceDocument()->frame()); |
438 if (!targetFrame) { | 438 if (!targetFrame) { |
439 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi
cator::processingUserGesture()) | 439 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi
cator::processingUserGesture()) |
440 return; | 440 return; |
441 targetFrame = document().frame(); | 441 targetFrame = document().frame(); |
442 } else { | 442 } else { |
443 submission->clearTarget(); | 443 submission->clearTarget(); |
444 } | 444 } |
445 if (!targetFrame->page()) | 445 if (!targetFrame->host()) |
446 return; | 446 return; |
447 | 447 |
448 if (MixedContentChecker::isMixedContent(document().securityOrigin(), submiss
ion->action())) { | 448 if (MixedContentChecker::isMixedContent(document().securityOrigin(), submiss
ion->action())) { |
449 UseCounter::count(document(), UseCounter::MixedContentFormsSubmitted); | 449 UseCounter::count(document(), UseCounter::MixedContentFormsSubmitted); |
450 if (!document().frame()->loader().mixedContentChecker()->canSubmitToInse
cureForm(document().securityOrigin(), submission->action())) | 450 if (!document().frame()->loader().mixedContentChecker()->canSubmitToInse
cureForm(document().securityOrigin(), submission->action())) |
451 return; | 451 return; |
452 } else { | 452 } else { |
453 UseCounter::count(document(), UseCounter::FormsSubmitted); | 453 UseCounter::count(document(), UseCounter::FormsSubmitted); |
454 } | 454 } |
455 | 455 |
456 targetFrame->navigationScheduler().scheduleFormSubmission(submission); | 456 // FIXME: Plumb form submission for remote frames. |
| 457 if (targetFrame->isLocalFrame()) |
| 458 toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission(
submission); |
457 } | 459 } |
458 | 460 |
459 void HTMLFormElement::reset() | 461 void HTMLFormElement::reset() |
460 { | 462 { |
461 LocalFrame* frame = document().frame(); | 463 LocalFrame* frame = document().frame(); |
462 if (m_isInResetFunction || !frame) | 464 if (m_isInResetFunction || !frame) |
463 return; | 465 return; |
464 | 466 |
465 m_isInResetFunction = true; | 467 m_isInResetFunction = true; |
466 | 468 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 } | 880 } |
879 | 881 |
880 void HTMLFormElement::setDemoted(bool demoted) | 882 void HTMLFormElement::setDemoted(bool demoted) |
881 { | 883 { |
882 if (demoted) | 884 if (demoted) |
883 UseCounter::count(document(), UseCounter::DemotedFormElement); | 885 UseCounter::count(document(), UseCounter::DemotedFormElement); |
884 m_wasDemoted = demoted; | 886 m_wasDemoted = demoted; |
885 } | 887 } |
886 | 888 |
887 } // namespace | 889 } // namespace |
OLD | NEW |