|
Lines 44-49
a/Source/WebCore/html/HTMLAnchorElement.cpp_sec1
|
| 44 |
#include "ResourceRequest.h" |
44 |
#include "ResourceRequest.h" |
| 45 |
#include "RuntimeEnabledFeatures.h" |
45 |
#include "RuntimeEnabledFeatures.h" |
| 46 |
#include "SVGImage.h" |
46 |
#include "SVGImage.h" |
|
|
47 |
#include "ScriptController.h" |
| 47 |
#include "SecurityOrigin.h" |
48 |
#include "SecurityOrigin.h" |
| 48 |
#include "SecurityPolicy.h" |
49 |
#include "SecurityPolicy.h" |
| 49 |
#include "Settings.h" |
50 |
#include "Settings.h" |
|
Lines 380-388
void HTMLAnchorElement::handleClick(Event& event)
a/Source/WebCore/html/HTMLAnchorElement.cpp_sec2
|
| 380 |
// If the a element has a download attribute and the algorithm is not triggered by user activation |
381 |
// If the a element has a download attribute and the algorithm is not triggered by user activation |
| 381 |
// then abort these steps. |
382 |
// then abort these steps. |
| 382 |
// https://html.spec.whatwg.org/#the-a-element:triggered-by-user-activation |
383 |
// https://html.spec.whatwg.org/#the-a-element:triggered-by-user-activation |
| 383 |
if (!downloadAttribute.isNull() && !event.isTrusted()) { |
384 |
if (!downloadAttribute.isNull() && !event.isTrusted() && !ScriptController::processingUserGesture()) { |
| 384 |
// The specification says to throw an InvalidAccessError but other browsers do not. |
385 |
// The specification says to throw an InvalidAccessError but other browsers do not. |
| 385 |
document().addConsoleMessage(MessageSource::Security, MessageLevel::Warning, "Synthetic clicks on anchors that have a download attribute are ignored."); |
386 |
document().addConsoleMessage(MessageSource::Security, MessageLevel::Warning, "Non user-triggered activations of anchors that have a download attribute are ignored."); |
| 386 |
return; |
387 |
return; |
| 387 |
} |
388 |
} |
| 388 |
} |
389 |
} |