mirror of
https://github.com/csd4ni3l/browser.git
synced 2026-01-01 04:03:43 +01:00
add tab support by having separate renderers and http clients, make link clicking open a new tab, add better default headers, fix style elements showing as text, fix crash if there are no needs but needs_render is True, fix view-source scheme not working,
This commit is contained in:
@@ -36,7 +36,8 @@ class HTML():
|
||||
for c in self.raw_html:
|
||||
if c == "<":
|
||||
in_tag = True
|
||||
if text: self.add_text(text) # start of new tag means before everything was content/text
|
||||
if (not self.unfinished or not self.unfinished[-1].tag == "style") and text:
|
||||
self.add_text(text) # start of new tag means before everything was content/text
|
||||
text = ""
|
||||
elif c == ">":
|
||||
in_tag = False
|
||||
@@ -173,6 +174,9 @@ def get_inline_styles(node):
|
||||
|
||||
for node in node.children:
|
||||
if isinstance(node, Element) and node.tag == "style":
|
||||
if not node.children:
|
||||
continue
|
||||
|
||||
if isinstance(node.children[0], Text):
|
||||
all_rules.extend(CSSParser(node.children[0].text).parse()) # node's first children will just be a text element that contains the css
|
||||
|
||||
|
||||
Reference in New Issue
Block a user