1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-17 18:51:10 +00:00
serenity/Libraries/LibWeb
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
..
Bindings LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
CodeGenerators LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
CSS LibWeb: Remove some unnecessary throwaway strings in the CSS parser 2020-08-07 20:35:05 +02:00
DOM LibWeb: Clear exceptions in each Document::run_javascript() call 2020-08-11 21:08:30 +02:00
HTML LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
Layout LibWeb: Move tree iteration helpers from Node/LayoutNode to TreeNode 2020-08-10 15:21:23 +02:00
Loader Refactor: Expose const_cast by removing ByteBuffer::warp(const void*, size_t) 2020-08-06 10:33:16 +02:00
Page LibWeb: Move text selection serialization from PageView to Frame 2020-08-06 19:59:24 +02:00
Painting LibWeb: Specialize hit testing for text cursor purposes 2020-08-05 16:57:51 +02:00
Scripts LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
SVG LibWeb: Fix some SVG crashes/hangs 2020-08-02 19:16:40 +02:00
Tests LibWeb: Add a very basic test for Text node APIs ("data" and "length") 2020-08-03 20:53:26 +02:00
UIEvents LibWeb: Oops, provide the correct WrapperType for UIEvent 2020-07-28 19:40:11 +02:00
CMakeLists.txt LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
DOMTreeModel.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
DOMTreeModel.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Dump.cpp LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
Dump.h LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
FontCache.cpp LibWeb: Rename directory LibHTML => LibWeb 2020-03-07 10:32:51 +01:00
FontCache.h LibWeb: Use FlyString in FontCache keys 2020-05-26 23:45:48 +02:00
Forward.h LibWeb: Add HTML elements to factories, add missing tags and attributes 2020-08-09 21:14:51 +02:00
LayoutTreeModel.cpp LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
LayoutTreeModel.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
Origin.h LibWeb: Add Origin concept (protocol, host, port tuple) 2020-04-07 23:01:45 +02:00
PageView.cpp LibWeb: Move text selection serialization from PageView to Frame 2020-08-06 19:59:24 +02:00
PageView.h LibWeb: Move the Page/Frame/EventHandler classes into Page/ 2020-07-28 19:28:29 +02:00
StylePropertiesModel.cpp LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
StylePropertiesModel.h LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
TreeNode.h LibWeb: Move tree iteration helpers from Node/LayoutNode to TreeNode 2020-08-10 15:21:23 +02:00
URLEncoder.cpp LibWeb: Use the URL encoder from AK instead of rolling a custom one 2020-06-15 17:56:00 +02:00
URLEncoder.h LibWeb: Use the URL encoder from AK instead of rolling a custom one 2020-06-15 17:56:00 +02:00
WebContentClient.cpp LibWeb: Make context menus work in WebContentView 2020-07-07 12:24:29 +02:00
WebContentClient.h LibWeb: Make context menus work in WebContentView 2020-07-07 12:24:29 +02:00
WebContentView.cpp LibWeb: Send key events to the WebContent process 2020-08-03 19:58:59 +02:00
WebContentView.h LibWeb: Send key events to the WebContent process 2020-08-03 19:58:59 +02:00
WebViewHooks.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00