зеркало из https://github.com/mozilla/gecko-dev.git
a03ae92655
Design: I realized having two different parsers for sync and async was wrong, because the API for both was fundamentally the same. All I needed to do was create another Tokenizer, because `ParseNode` ( representation for nodes which are yet to be created) is used by the TreeBuilder and the Sink, and the `Tokenizer` is the 'lowermost' type concerned with these two types. Therefore, I created one and placed it in `async_html.rs`, and also created a new Sink which deals with `ParseNode`s. I changed the methods in ServoParser to take an `async` argument too, which decides which Tokenizer will be used. The Tokenizer isn't exactly *async* for now, but this PR separates action creation from execution, which allows the async behaviour to be implemented later. Right now, all actions are executed soon after they are created. The Sink consists of two Hashmaps, `nodes`, which contains the actual nodes, with the key being their corresponding `ParseNode`'s id, and `parse_node_data`, which contains metadata about the nodes. It's still a bit rough, (I can't figure out how to deal with `complete_script` and `is_mathml_annotation_xml_integration_point`, along with some other parts I wrote in a hurry), but I believe the overall design is sound. I'd like to hear what you think about it. Source-Repo: https://github.com/servo/servo Source-Revision: 9c2dffdf72efe4274bb514407edc552b14fc0a4d --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 706e41f53fd00305d695faa3c78757c6771cf6c9 |
||
---|---|---|
.. | ||
ahem | ||
user-agent-js | ||
Credits.rtf.mako | ||
Servo.ico | ||
ahem.css | ||
android_params | ||
badcert.html | ||
badcert.jpg | ||
cert-google-only | ||
certs | ||
failure.html | ||
gatt_blocklist.txt | ||
hsts_preload.json | ||
iso-8859-8.css | ||
itried.jpg | ||
neterror.html | ||
not-found.html | ||
package-prefs.json | ||
prefs.json | ||
presentational-hints.css | ||
privatekey_for_testing.key | ||
public_domains.txt | ||
quirks-mode.css | ||
quotes.css | ||
rippy.png | ||
self_signed_certificate_for_testing.crt | ||
servo.css | ||
servo.icns | ||
servo.png | ||
tumbeast.png | ||
user-agent.css |