Resolves the CSS3 stylesheets that compose the end-style of an HTML5 element.
A CSS3 Selector string of the element we wish to inspect its style.
If you are unfamiliar with CSS3 Selectors have a look in Finding the correct CSS3 Selector article.
A Boolean if we prefer the output in XML format instead of JSON which is the default.
Resolves the CSS3 stylesheets that compose the end-style of an HTML5 element.
A CSS3 Selector string of the element we wish to inspect its style.
If you are unfamiliar with CSS3 Selectors have a look in Finding the correct CSS3 Selector article.
A Boolean if we prefer the output in XML format instead of JSON which is the default.
An XML or JSON string with all the CSS3 stylesheets, including User Agent styles, attribute styles and inline styles, that compose the end-style of an HTML5 element.
The result of this method provides the information required in order to generate a detailed list of stylesheets and how stylesheet rules compose the end-style of an HTML5 element.
The functionality can be used to reproduce the CSS3 inspector of Chromium DevTools.
Private Sub HTML5_ReadSelectorCSS() Dim XML As String XML = WebKitX.GetMatchedStyles(CurrentSelector, True) frm_Panel_CSS3.ReadCSS WebKitX.URL, CurrentSelector, XML, StyleSheets End Sub Private Sub WebKitX_OnDevToolsWebSocket(ByVal Data As String) On Error Resume Next If InStr(Data, "CSS.styleSheetAdded") > 0 Then Dim xDOM As Object Set xDOM = XML_DOM(JSONtoXML(Data)) StyleSheets.Add xDOM.selectSingleNode("//styleSheetId").Text, xDOM.selectSingleNode("//sourceURL").Text End If Err.Clear End Sub Public Function XML_DOM(Optional sAnyXML) As IXMLDOMDocument Dim xDOM As DOMDocument30 Set xDOM = New DOMDocument30 xDOM.Async = False xDOM.resolveExternals = False xDOM.validateOnParse = False If Not IsMissing(sAnyXML) Then If IsObject(sAnyXML) Then xDOM.Load sAnyXML ElseIf sAnyXML <> vbNullString Then If InStrB(sAnyXML, "<") Then xDOM.loadXML sAnyXML Else xDOM.Load sAnyXML End If End If End If xDOM.SetProperty "SelectionLanguage", "XPath" xDOM.SetProperty "SelectionNamespaces", vbNullString Set XML_DOM = xDOM End Function