mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout changeset 40b0d61c132b due to bad commit message
This commit is contained in:
parent
7d55f14a91
commit
eddcc53a6c
@ -444,8 +444,6 @@
|
||||
@BINPATH@/res/EditorOverride.css
|
||||
@BINPATH@/res/contenteditable.css
|
||||
@BINPATH@/res/designmode.css
|
||||
@BINPATH@/res/TopLevelImageDocument.css
|
||||
@BINPATH@/res/TopLevelVideoDocument.css
|
||||
@BINPATH@/res/table-add-column-after-active.gif
|
||||
@BINPATH@/res/table-add-column-after-hover.gif
|
||||
@BINPATH@/res/table-add-column-after.gif
|
||||
|
@ -652,23 +652,24 @@ ImageDocument::CreateSyntheticDocument()
|
||||
// the size of the paper and cannot break into continuations along
|
||||
// multiple pages.
|
||||
Element* head = GetHeadElement();
|
||||
NS_ENSURE_TRUE(head, NS_ERROR_FAILURE);
|
||||
if (!head) {
|
||||
NS_WARNING("no head on image document!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
if (nsContentUtils::IsChildOfSameType(this)) {
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::style, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||
nsRefPtr<nsGenericHTMLElement> styleContent = NS_NewHTMLStyleElement(nodeInfo.forget());
|
||||
NS_ENSURE_TRUE(styleContent, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
styleContent->SetTextContent(NS_LITERAL_STRING("img { display: block; }"));
|
||||
head->AppendChildTo(styleContent, false);
|
||||
} else {
|
||||
LinkStylesheet(NS_LITERAL_STRING("resource://gre/res/TopLevelImageDocument.css"));
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::style, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||
nsRefPtr<nsGenericHTMLElement> styleContent = NS_NewHTMLStyleElement(nodeInfo.forget());
|
||||
if (!styleContent) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
styleContent->SetTextContent(NS_LITERAL_STRING("img { display: block; }"));
|
||||
head->AppendChildTo(styleContent, false);
|
||||
|
||||
// Add the image element
|
||||
Element* body = GetBodyElement();
|
||||
if (!body) {
|
||||
|
@ -243,7 +243,9 @@ MediaDocument::CreateSyntheticDocument()
|
||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsRefPtr<nsGenericHTMLElement> root = NS_NewHTMLHtmlElement(nodeInfo.forget());
|
||||
NS_ENSURE_TRUE(root, NS_ERROR_OUT_OF_MEMORY);
|
||||
if (!root) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_ASSERTION(GetChildCount() == 0, "Shouldn't have any kids");
|
||||
rv = AppendChildTo(root, false);
|
||||
@ -256,15 +258,20 @@ MediaDocument::CreateSyntheticDocument()
|
||||
|
||||
// Create a <head> so our title has somewhere to live
|
||||
nsRefPtr<nsGenericHTMLElement> head = NS_NewHTMLHeadElement(nodeInfo.forget());
|
||||
NS_ENSURE_TRUE(head, NS_ERROR_OUT_OF_MEMORY);
|
||||
if (!head) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::meta, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||
nsCOMPtr<nsINodeInfo> nodeInfoMeta;
|
||||
nodeInfoMeta = mNodeInfoManager->GetNodeInfo(nsGkAtoms::meta, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
NS_ENSURE_TRUE(nodeInfoMeta, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsRefPtr<nsGenericHTMLElement> metaContent = NS_NewHTMLMetaElement(nodeInfo.forget());
|
||||
NS_ENSURE_TRUE(metaContent, NS_ERROR_OUT_OF_MEMORY);
|
||||
nsRefPtr<nsGenericHTMLElement> metaContent = NS_NewHTMLMetaElement(nodeInfoMeta.forget());
|
||||
if (!metaContent) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
metaContent->SetAttr(kNameSpaceID_None, nsGkAtoms::name,
|
||||
NS_LITERAL_STRING("viewport"),
|
||||
true);
|
||||
@ -282,7 +289,9 @@ MediaDocument::CreateSyntheticDocument()
|
||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsRefPtr<nsGenericHTMLElement> body = NS_NewHTMLBodyElement(nodeInfo.forget());
|
||||
NS_ENSURE_TRUE(body, NS_ERROR_OUT_OF_MEMORY);
|
||||
if (!body) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
root->AppendChildTo(body, false);
|
||||
|
||||
@ -345,27 +354,6 @@ MediaDocument::GetFileName(nsAString& aResult)
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
MediaDocument::LinkStylesheet(const nsAString& aStylesheet)
|
||||
{
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::link, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsRefPtr<nsGenericHTMLElement> link = NS_NewHTMLLinkElement(nodeInfo.forget());
|
||||
NS_ENSURE_TRUE(link, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
link->SetAttr(kNameSpaceID_None, nsGkAtoms::rel,
|
||||
NS_LITERAL_STRING("stylesheet"), true);
|
||||
|
||||
link->SetAttr(kNameSpaceID_None, nsGkAtoms::href, aStylesheet, true);
|
||||
|
||||
Element* head = GetHeadElement();
|
||||
return head->AppendChildTo(link, false);
|
||||
}
|
||||
|
||||
void
|
||||
MediaDocument::UpdateTitleAndCharset(const nsACString& aTypeStr,
|
||||
const char* const* aFormatNames,
|
||||
|
@ -72,8 +72,6 @@ protected:
|
||||
|
||||
void GetFileName(nsAString& aResult);
|
||||
|
||||
nsresult LinkStylesheet(const nsAString& aStylesheet);
|
||||
|
||||
// |aFormatNames[]| needs to have four elements in the following order:
|
||||
// a format name with neither dimension nor file, a format name with
|
||||
// filename but w/o dimension, a format name with dimension but w/o filename,
|
||||
|
@ -135,9 +135,10 @@ VideoDocument::CreateSyntheticVideoDocument(nsIChannel* aChannel,
|
||||
true);
|
||||
} else {
|
||||
Element* head = GetHeadElement();
|
||||
NS_ENSURE_TRUE(head, NS_ERROR_FAILURE);
|
||||
|
||||
LinkStylesheet(NS_LITERAL_STRING("resource://gre/res/TopLevelVideoDocument.css"));
|
||||
if (!head) {
|
||||
NS_WARNING("no head on video document!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::style, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
|
@ -167,8 +167,6 @@ LOCAL_INCLUDES = \
|
||||
_FILES = \
|
||||
contenteditable.css \
|
||||
designmode.css \
|
||||
TopLevelImageDocument.css \
|
||||
TopLevelVideoDocument.css \
|
||||
$(NULL)
|
||||
|
||||
GARBAGE += $(addprefix $(DIST)/bin/res/,$(_FILES))
|
||||
|
@ -1,38 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla.org code.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Carlo Alberto Ferraris <cafxx@strayorange.com>
|
||||
* Jared Wein <jwein@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
This CSS stylesheet defines the rules to be applied to ImageDocuments that
|
||||
are top level (e.g. not iframes).
|
||||
*/
|
@ -1,38 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla.org code.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Carlo Alberto Ferraris <cafxx@strayorange.com>
|
||||
* Jared Wein <jwein@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
This CSS stylesheet defines the rules to be applied to VideoDocuments that
|
||||
are top level (e.g. not iframes).
|
||||
*/
|
Loading…
Reference in New Issue
Block a user