| 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 410 |
| 411 if (protocolIsJavaScript(submission->action())) { | 411 if (protocolIsJavaScript(submission->action())) { |
| 412 if (!document().contentSecurityPolicy()->allowFormAction(submission->act
ion())) | 412 if (!document().contentSecurityPolicy()->allowFormAction(submission->act
ion())) |
| 413 return; | 413 return; |
| 414 document().frame()->script().executeScriptIfJavaScriptURL(submission->ac
tion()); | 414 document().frame()->script().executeScriptIfJavaScriptURL(submission->ac
tion()); |
| 415 return; | 415 return; |
| 416 } | 416 } |
| 417 | 417 |
| 418 Frame* targetFrame = document().frame()->findFrameForNavigation(submission->
target(), *document().frame()); | 418 Frame* targetFrame = document().frame()->findFrameForNavigation(submission->
target(), *document().frame()); |
| 419 if (!targetFrame) { | 419 if (!targetFrame) { |
| 420 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi
cator::processingUserGesture()) | 420 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi
cator::utilizeUserGesture()) |
| 421 return; | 421 return; |
| 422 targetFrame = document().frame(); | 422 targetFrame = document().frame(); |
| 423 } else { | 423 } else { |
| 424 submission->clearTarget(); | 424 submission->clearTarget(); |
| 425 } | 425 } |
| 426 if (!targetFrame->host()) | 426 if (!targetFrame->host()) |
| 427 return; | 427 return; |
| 428 | 428 |
| 429 UseCounter::count(document(), UseCounter::FormsSubmitted); | 429 UseCounter::count(document(), UseCounter::FormsSubmitted); |
| 430 if (MixedContentChecker::isMixedFormAction(document().frame(), submission->a
ction())) | 430 if (MixedContentChecker::isMixedFormAction(document().frame(), submission->a
ction())) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 458 } | 458 } |
| 459 | 459 |
| 460 void HTMLFormElement::requestAutocomplete() | 460 void HTMLFormElement::requestAutocomplete() |
| 461 { | 461 { |
| 462 String errorMessage; | 462 String errorMessage; |
| 463 | 463 |
| 464 if (!document().frame()) | 464 if (!document().frame()) |
| 465 errorMessage = "requestAutocomplete: form is not owned by a displayed do
cument."; | 465 errorMessage = "requestAutocomplete: form is not owned by a displayed do
cument."; |
| 466 else if (!shouldAutocomplete()) | 466 else if (!shouldAutocomplete()) |
| 467 errorMessage = "requestAutocomplete: form autocomplete attribute is set
to off."; | 467 errorMessage = "requestAutocomplete: form autocomplete attribute is set
to off."; |
| 468 else if (!UserGestureIndicator::processingUserGesture()) | 468 else if (!UserGestureIndicator::utilizeUserGesture()) |
| 469 errorMessage = "requestAutocomplete: must be called in response to a use
r gesture."; | 469 errorMessage = "requestAutocomplete: must be called in response to a use
r gesture."; |
| 470 | 470 |
| 471 if (!errorMessage.isEmpty()) { | 471 if (!errorMessage.isEmpty()) { |
| 472 document().addConsoleMessage(ConsoleMessage::create(RenderingMessageSour
ce, LogMessageLevel, errorMessage)); | 472 document().addConsoleMessage(ConsoleMessage::create(RenderingMessageSour
ce, LogMessageLevel, errorMessage)); |
| 473 finishRequestAutocomplete(AutocompleteResultErrorDisabled); | 473 finishRequestAutocomplete(AutocompleteResultErrorDisabled); |
| 474 } else { | 474 } else { |
| 475 document().frame()->loader().client()->didRequestAutocomplete(this); | 475 document().frame()->loader().client()->didRequestAutocomplete(this); |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 { | 832 { |
| 833 for (const auto& control : associatedElements()) { | 833 for (const auto& control : associatedElements()) { |
| 834 if (!control->isFormControlElement()) | 834 if (!control->isFormControlElement()) |
| 835 continue; | 835 continue; |
| 836 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) | 836 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) |
| 837 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); | 837 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); |
| 838 } | 838 } |
| 839 } | 839 } |
| 840 | 840 |
| 841 } // namespace blink | 841 } // namespace blink |
| OLD | NEW |