1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-18 08:01:00 +00:00
serenity/Libraries/LibWeb/DOM
Linus Groh 1d728af5c4 LibWeb: Clear exceptions in each Document::run_javascript() call
We don't want to carry over exceptions across multiple
Document::run_javascript() calls as Interpreter::run() and every of its
exception checks will get confused - in this case there would be an
exception, but not because a certain action failed.

Real-life example:

<script>var a = {}; a.test()</script>
<script>alert("It worked!")</script>

The above HTML will invoke Document::run_javascript() twice, the first
call will result in a TypeError, which is still stored during the second
call. The interpreter will eventually call the following functions (in
order) for the alert() invocation:

- Identifier::execute()
- Interpreter::get_variable()
- Object::get() (on the global object)

That last Object::get() call has an exception check which is triggered
as we still carry around the exception from earlier - and eventually
returns an empty value.

Long story short, the second script will wrongly fail with
"ReferenceError, 'alert' is not defined".

Fixes #3091.
2020-08-11 21:08:30 +02:00
..
Attribute.h LibWeb: Move Attribute to its own header file 2020-05-22 21:45:00 +02:00
AttributeNames.cpp LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
AttributeNames.h LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
CharacterData.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
CharacterData.h LibWeb: Add CharacterData and Text IDL interfaces 2020-08-03 20:50:45 +02:00
CharacterData.idl LibWeb: Add CharacterData and Text IDL interfaces 2020-08-03 20:50:45 +02:00
Comment.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Comment.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Document.cpp LibWeb: Clear exceptions in each Document::run_javascript() call 2020-08-11 21:08:30 +02:00
Document.h LibWeb: Make sure that head and body always get the HTML element 2020-08-04 11:05:14 +02:00
Document.idl LibWeb: Add the Document.documentElement API 2020-08-03 13:30:18 +02:00
DocumentFragment.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
DocumentType.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
DocumentType.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
DocumentType.idl LibWeb: Implement quirks mode detection 2020-07-21 01:08:32 +02:00
Element.cpp LibWeb: Move contentEditable from Element to HTMLElement 2020-08-03 12:47:58 +02:00
Element.h LibWeb: Move "element sibling" getters to NonDocumentTypeChildNode 2020-08-03 20:30:02 +02:00
Element.idl LibWeb: Add Element.{next,previous}ElementSibling IDL attributes 2020-08-03 20:32:06 +02:00
ElementFactory.cpp LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
ElementFactory.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Event.h LibWeb: Add UIEvent class (base of MouseEvent, and others) 2020-07-28 19:39:17 +02:00
Event.idl LibWeb: Generate Event and MouseEvent bindings from IDL :^) 2020-06-21 16:12:28 +02:00
EventListener.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
EventListener.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
EventTarget.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
EventTarget.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
EventTarget.idl LibWeb: Add EventTarget.removeEventListener() 2020-06-21 12:37:34 +02:00
Node.cpp LibWeb: Move "element sibling" getters to NonDocumentTypeChildNode 2020-08-03 20:30:02 +02:00
Node.h LibWeb: Move tree iteration helpers from Node/LayoutNode to TreeNode 2020-08-10 15:21:23 +02:00
Node.idl LibWeb: Add Node.insertBefore(Node node, Node? child) 2020-06-21 17:42:00 +02:00
NonDocumentTypeChildNode.h LibWeb: Move "element sibling" getters to NonDocumentTypeChildNode 2020-08-03 20:30:02 +02:00
NonElementParentNode.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
ParentNode.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
ParentNode.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Position.cpp LibWeb: Add a basic DOM::Position class 2020-08-02 17:34:50 +02:00
Position.h LibWeb: Allow inserting text at the cursor by typing characters :^) 2020-08-02 17:34:50 +02:00
TagNames.cpp LibWeb: Use HTML::TagNames globals in the new HTML parser 2020-06-07 23:53:16 +02:00
TagNames.h LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
Text.cpp LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
Text.h LibWeb: Add CharacterData and Text IDL interfaces 2020-08-03 20:50:45 +02:00
Text.idl LibWeb: Add CharacterData and Text IDL interfaces 2020-08-03 20:50:45 +02:00
Timer.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Timer.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Window.cpp LibWeb: Move the Page/Frame/EventHandler classes into Page/ 2020-07-28 19:28:29 +02:00
Window.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
XMLHttpRequest.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
XMLHttpRequest.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00