| 307 | } |
| 308 | |
| 309 | int DocumentHost::GetDocumentMode(IHTMLDocument2* doc) { |
| 310 | LOG(TRACE) << "Entering DocumentHost::GetDocumentMode"; |
| 311 | CComPtr<IHTMLDocument6> mode_doc; |
| 312 | doc->QueryInterface<IHTMLDocument6>(&mode_doc); |
| 313 | if (!mode_doc) { |
| 314 | LOG(DEBUG) << "QueryInterface for IHTMLDocument6 fails, so document mode must be 7 or less."; |
| 315 | return 5; |
| 316 | } |
| 317 | CComVariant mode; |
| 318 | HRESULT hr = mode_doc->get_documentMode(&mode); |
| 319 | if (FAILED(hr)) { |
| 320 | LOGHR(WARN, hr) << "get_documentMode failed."; |
| 321 | return 5; |
| 322 | } |
| 323 | int document_mode = static_cast<int>(mode.fltVal); |
| 324 | return document_mode; |
| 325 | } |
| 326 | |
| 327 | bool DocumentHost::IsStandardsMode(IHTMLDocument2* doc) { |
| 328 | LOG(TRACE) << "Entering DocumentHost::IsStandardsMode"; |