@@ 51,15 51,13 @@ renderElLBS el = XML.renderLBS XML.def $ XML.Document {
}
retreiveStyles uri html manager base = do
- style <- H2C.externalStylesForURL authorStyle testMedia html base loadURL
- userStyle <- loadUserStyles style
+ userStyle <- loadUserStyles agentStyle
importedStyle <- CSSCond.loadImports loadURL lowerVars lowerToks userStyle []
return $ CSSCond.resolve lowerVars lowerToks Style.queryableStyleSheet importedStyle
where
- emptyStyle :: CSSCond.ConditionalStyles StyleTree
- emptyStyle = CSSCond.conditionalStyles uri "document"
- agentStyle = H2C.cssPriorityAgent emptyStyle `CSS.parse` Txt.pack userAgentCSS
- authorStyle = H2C.internalStylesForURL testMedia agentStyle base html
+ agentStyle = H2C.cssPriorityAgent authorStyle `CSS.parse` Txt.pack userAgentCSS
+ authorStyle :: CSSCond.ConditionalStyles StyleTree
+ authorStyle = H2C.html2css html base
loadURL url = do -- TODO parallelise.
request <- requestFromURI url
@@ 85,9 83,6 @@ loadUserStyles styles = do
CSS.parse style (Txt.pack source) `loadFiles` files
loadFiles style [] = return style
-testMedia attrs = media == Nothing || media == Just "speech"
- where media = "media" `M.lookup` attrs
-
stylize styles html = H2C.traversePrepopulatedStyles buildChild buildNode buildText styles html
where