Merge inbound to m-c. a=merge

This commit is contained in:
Ryan VanderMeulen
2017-01-07 11:22:47 -05:00
258 changed files with 4983 additions and 2151 deletions

View File

@@ -1662,40 +1662,40 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
// Get the content value
const nsStyleContentData &data =
aStyleContext->StyleContent()->ContentAt(aContentIndex);
nsStyleContentType type = data.mType;
if (eStyleContentType_Image == type) {
if (!data.mContent.mImage) {
// CSS had something specified that couldn't be converted to an
// image object
return nullptr;
}
// Create an image content object and pass it the image request.
// XXX Check if it's an image type we can handle...
RefPtr<NodeInfo> nodeInfo;
nodeInfo = mDocument->NodeInfoManager()->
GetNodeInfo(nsGkAtoms::mozgeneratedcontentimage, nullptr,
kNameSpaceID_XHTML, nsIDOMNode::ELEMENT_NODE);
nsCOMPtr<nsIContent> content;
NS_NewGenConImageContent(getter_AddRefs(content), nodeInfo.forget(),
data.mContent.mImage);
return content.forget();
}
nsStyleContentType type = data.GetType();
switch (type) {
case eStyleContentType_String:
return CreateGenConTextNode(aState,
nsDependentString(data.mContent.mString),
nullptr, nullptr);
case eStyleContentType_Image: {
imgRequestProxy* image = data.GetImage();
if (!image) {
// CSS had something specified that couldn't be converted to an
// image object
return nullptr;
}
case eStyleContentType_Attr:
{
// Create an image content object and pass it the image request.
// XXX Check if it's an image type we can handle...
RefPtr<NodeInfo> nodeInfo;
nodeInfo = mDocument->NodeInfoManager()->
GetNodeInfo(nsGkAtoms::mozgeneratedcontentimage, nullptr,
kNameSpaceID_XHTML, nsIDOMNode::ELEMENT_NODE);
nsCOMPtr<nsIContent> content;
NS_NewGenConImageContent(getter_AddRefs(content), nodeInfo.forget(),
image);
return content.forget();
}
case eStyleContentType_String:
return CreateGenConTextNode(aState,
nsDependentString(data.GetString()),
nullptr, nullptr);
case eStyleContentType_Attr: {
nsCOMPtr<nsIAtom> attrName;
int32_t attrNameSpace = kNameSpaceID_None;
nsAutoString contentString(data.mContent.mString);
nsAutoString contentString(data.GetString());
int32_t barIndex = contentString.FindChar('|'); // CSS namespace delimiter
if (-1 != barIndex) {
@@ -1728,10 +1728,9 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
return content.forget();
}
case eStyleContentType_Counter:
case eStyleContentType_Counters:
{
nsCSSValue::Array* counters = data.mContent.mCounters;
case eStyleContentType_Counter:
case eStyleContentType_Counters: {
nsCSSValue::Array* counters = data.GetCounters();
nsCounterList* counterList = mCounterManager.CounterListFor(
nsDependentString(counters->Item(0).GetStringBufferValue()));
@@ -1747,15 +1746,10 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
initializer);
}
case eStyleContentType_Image:
NS_NOTREACHED("handled by if above");
return nullptr;
case eStyleContentType_OpenQuote:
case eStyleContentType_CloseQuote:
case eStyleContentType_NoOpenQuote:
case eStyleContentType_NoCloseQuote:
{
case eStyleContentType_OpenQuote:
case eStyleContentType_CloseQuote:
case eStyleContentType_NoOpenQuote:
case eStyleContentType_NoCloseQuote: {
nsQuoteNode* node =
new nsQuoteNode(type, aContentIndex);
@@ -1766,8 +1760,7 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
initializer);
}
case eStyleContentType_AltContent:
{
case eStyleContentType_AltContent: {
// Use the "alt" attribute; if that fails and the node is an HTML
// <input>, try the value attribute and then fall back to some default
// localized text we have.
@@ -1798,10 +1791,10 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
break;
}
case eStyleContentType_Uninitialized:
NS_NOTREACHED("uninitialized content type");
return nullptr;
} // switch
case eStyleContentType_Uninitialized:
NS_NOTREACHED("uninitialized content type");
return nullptr;
}
return nullptr;
}