mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 783565 - Don't look for mobile doctype or handheldFriendly if there is also a meta viewport tag [r=jwir3]
This commit is contained in:
parent
bd3aac02af
commit
540d51b015
@ -5056,31 +5056,32 @@ nsContentUtils::GetViewportInfo(nsIDocument *aDocument)
|
||||
ret.autoSize = true;
|
||||
ret.allowZoom = true;
|
||||
|
||||
// If the docType specifies that we are on a site optimized for mobile,
|
||||
// then we want to return specially crafted defaults for the viewport info.
|
||||
nsCOMPtr<nsIDOMDocument>
|
||||
domDoc(do_QueryInterface(aDocument));
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentType> docType;
|
||||
nsresult rv = domDoc->GetDoctype(getter_AddRefs(docType));
|
||||
if (NS_SUCCEEDED(rv) && docType) {
|
||||
nsAutoString docId;
|
||||
rv = docType->GetPublicId(docId);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if ((docId.Find("WAP") != -1) ||
|
||||
(docId.Find("Mobile") != -1) ||
|
||||
(docId.Find("WML") != -1))
|
||||
{
|
||||
return ret;
|
||||
nsAutoString viewport;
|
||||
aDocument->GetHeaderData(nsGkAtoms::viewport, viewport);
|
||||
if (viewport.IsEmpty()) {
|
||||
// If the docType specifies that we are on a site optimized for mobile,
|
||||
// then we want to return specially crafted defaults for the viewport info.
|
||||
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(aDocument));
|
||||
nsCOMPtr<nsIDOMDocumentType> docType;
|
||||
nsresult rv = domDoc->GetDoctype(getter_AddRefs(docType));
|
||||
if (NS_SUCCEEDED(rv) && docType) {
|
||||
nsAutoString docId;
|
||||
rv = docType->GetPublicId(docId);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if ((docId.Find("WAP") != -1) ||
|
||||
(docId.Find("Mobile") != -1) ||
|
||||
(docId.Find("WML") != -1))
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString handheldFriendly;
|
||||
aDocument->GetHeaderData(nsGkAtoms::handheldFriendly, handheldFriendly);
|
||||
|
||||
if (handheldFriendly.EqualsLiteral("true")) {
|
||||
return ret;
|
||||
nsAutoString handheldFriendly;
|
||||
aDocument->GetHeaderData(nsGkAtoms::handheldFriendly, handheldFriendly);
|
||||
if (handheldFriendly.EqualsLiteral("true")) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString minScaleStr;
|
||||
@ -5233,6 +5234,8 @@ nsContentUtils::ProcessViewportInfo(nsIDocument *aDocument,
|
||||
/* We never fail. */
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
aDocument->SetHeaderData(nsGkAtoms::viewport, viewportInfo);
|
||||
|
||||
/* Iterators. */
|
||||
nsAString::const_iterator tip, tail, end;
|
||||
viewportInfo.BeginReading(tip);
|
||||
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
|
||||
|
||||
<!--
|
||||
The <meta name="viewport"> tag takes precedence over the doctype, so this
|
||||
should *not* be treated as a "mobile" site (bug 783565).
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=10000">
|
||||
<style>
|
||||
p { font-size: 12px; line-height: 1.0;}
|
||||
</style>
|
||||
<body>
|
||||
<p>Some uninflated text.</p>
|
||||
</body>
|
||||
</head>
|
||||
</html>
|
@ -55,6 +55,7 @@ test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineTh
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-2.html disable-fontinfl-on-mobile-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-3.html disable-fontinfl-on-mobile-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-4.html disable-fontinfl-on-mobile-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) != disable-fontinfl-on-mobile-5.html disable-fontinfl-on-mobile-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == preformatted-text.html preformatted-text-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body.html fixed-height-body-ref.html
|
||||
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body-child.html fixed-height-body-child-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user