2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-05-28 11:43:44 +04:00
|
|
|
|
2013-02-07 18:57:13 +04:00
|
|
|
#include "mozilla/dom/HTMLHRElement.h"
|
2013-02-07 18:57:59 +04:00
|
|
|
#include "mozilla/dom/HTMLHRElementBinding.h"
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2004-05-19 00:58:12 +04:00
|
|
|
NS_IMPL_NS_NEW_HTML_ELEMENT(HR)
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2013-02-07 18:57:13 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2014-06-20 06:01:40 +04:00
|
|
|
HTMLHRElement::HTMLHRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2004-05-19 00:58:12 +04:00
|
|
|
: nsGenericHTMLElement(aNodeInfo)
|
1998-08-29 03:27:19 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-02-07 18:57:13 +04:00
|
|
|
HTMLHRElement::~HTMLHRElement()
|
1998-08-29 03:27:19 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS_INHERITED(HTMLHRElement, nsGenericHTMLElement,
|
|
|
|
nsIDOMHTMLHRElement)
|
1998-08-29 03:27:19 +04:00
|
|
|
|
2013-02-07 18:57:13 +04:00
|
|
|
NS_IMPL_ELEMENT_CLONE(HTMLHRElement)
|
1998-09-11 08:16:18 +04:00
|
|
|
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2013-02-07 18:57:13 +04:00
|
|
|
NS_IMPL_STRING_ATTR(HTMLHRElement, Align, align)
|
|
|
|
NS_IMPL_BOOL_ATTR(HTMLHRElement, NoShade, noshade)
|
|
|
|
NS_IMPL_STRING_ATTR(HTMLHRElement, Size, size)
|
|
|
|
NS_IMPL_STRING_ATTR(HTMLHRElement, Width, width)
|
|
|
|
NS_IMPL_STRING_ATTR(HTMLHRElement, Color, color)
|
1998-08-29 03:27:19 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2013-02-07 18:57:13 +04:00
|
|
|
HTMLHRElement::ParseAttribute(int32_t aNamespaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
const nsAString& aValue,
|
|
|
|
nsAttrValue& aResult)
|
1998-08-29 03:27:19 +04:00
|
|
|
{
|
2013-11-19 23:21:29 +04:00
|
|
|
static const nsAttrValue::EnumTable kAlignTable[] = {
|
|
|
|
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
|
|
|
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
|
|
|
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
2005-12-04 19:31:26 +03:00
|
|
|
if (aNamespaceID == kNameSpaceID_None) {
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::width) {
|
2011-02-04 22:46:16 +03:00
|
|
|
return aResult.ParseSpecialIntValue(aValue);
|
2005-11-29 19:37:15 +03:00
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::size) {
|
2005-11-29 19:37:15 +03:00
|
|
|
return aResult.ParseIntWithBounds(aValue, 1, 1000);
|
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::align) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return aResult.ParseEnumValue(aValue, kAlignTable, false);
|
2005-11-29 19:37:15 +03:00
|
|
|
}
|
2006-12-26 20:47:52 +03:00
|
|
|
if (aAttribute == nsGkAtoms::color) {
|
2010-07-17 12:09:14 +04:00
|
|
|
return aResult.ParseColor(aValue);
|
2005-11-29 19:37:15 +03:00
|
|
|
}
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
2000-12-23 13:56:31 +03:00
|
|
|
|
2005-11-29 19:37:15 +03:00
|
|
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
|
|
|
aResult);
|
1998-08-29 03:27:19 +04:00
|
|
|
}
|
|
|
|
|
2013-11-19 23:21:29 +04:00
|
|
|
void
|
|
|
|
HTMLHRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData)
|
1998-08-29 03:27:19 +04:00
|
|
|
{
|
2011-09-29 10:19:26 +04:00
|
|
|
bool noshade = false;
|
2003-07-30 12:13:07 +04:00
|
|
|
|
2006-12-26 20:47:52 +03:00
|
|
|
const nsAttrValue* colorValue = aAttributes->GetAttr(nsGkAtoms::color);
|
2004-02-11 03:09:59 +03:00
|
|
|
nscolor color;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool colorIsSet = colorValue && colorValue->GetColorValue(color);
|
2003-07-30 12:13:07 +04:00
|
|
|
|
2007-10-09 01:58:22 +04:00
|
|
|
if (aData->mSIDs & (NS_STYLE_INHERIT_BIT(Position) |
|
|
|
|
NS_STYLE_INHERIT_BIT(Border))) {
|
2003-07-30 12:13:07 +04:00
|
|
|
if (colorIsSet) {
|
2011-10-17 18:59:28 +04:00
|
|
|
noshade = true;
|
2003-07-30 12:13:07 +04:00
|
|
|
} else {
|
2006-12-26 20:47:52 +03:00
|
|
|
noshade = !!aAttributes->GetAttr(nsGkAtoms::noshade);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-09 01:58:22 +04:00
|
|
|
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Margin)) {
|
1998-08-29 03:27:19 +04:00
|
|
|
// align: enum
|
2006-12-26 20:47:52 +03:00
|
|
|
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
|
2004-04-13 20:45:59 +04:00
|
|
|
if (value && value->Type() == nsAttrValue::eEnum) {
|
1999-03-05 07:20:07 +03:00
|
|
|
// Map align attribute into auto side margins
|
2015-01-17 07:16:02 +03:00
|
|
|
nsCSSValue* marginLeft = aData->ValueForMarginLeft();
|
|
|
|
nsCSSValue* marginRight = aData->ValueForMarginRight();
|
2004-04-13 20:45:59 +04:00
|
|
|
switch (value->GetEnumValue()) {
|
1999-03-05 07:20:07 +03:00
|
|
|
case NS_STYLE_TEXT_ALIGN_LEFT:
|
2011-03-18 06:14:31 +03:00
|
|
|
if (marginLeft->GetUnit() == eCSSUnit_Null)
|
|
|
|
marginLeft->SetFloatValue(0.0f, eCSSUnit_Pixel);
|
|
|
|
if (marginRight->GetUnit() == eCSSUnit_Null)
|
|
|
|
marginRight->SetAutoValue();
|
1999-03-05 07:20:07 +03:00
|
|
|
break;
|
|
|
|
case NS_STYLE_TEXT_ALIGN_RIGHT:
|
2011-03-18 06:14:31 +03:00
|
|
|
if (marginLeft->GetUnit() == eCSSUnit_Null)
|
|
|
|
marginLeft->SetAutoValue();
|
|
|
|
if (marginRight->GetUnit() == eCSSUnit_Null)
|
|
|
|
marginRight->SetFloatValue(0.0f, eCSSUnit_Pixel);
|
1999-03-05 07:20:07 +03:00
|
|
|
break;
|
|
|
|
case NS_STYLE_TEXT_ALIGN_CENTER:
|
2011-03-18 06:14:31 +03:00
|
|
|
if (marginLeft->GetUnit() == eCSSUnit_Null)
|
|
|
|
marginLeft->SetAutoValue();
|
|
|
|
if (marginRight->GetUnit() == eCSSUnit_Null)
|
|
|
|
marginRight->SetAutoValue();
|
1999-03-05 07:20:07 +03:00
|
|
|
break;
|
|
|
|
}
|
1998-08-29 03:27:19 +04:00
|
|
|
}
|
2001-06-01 02:19:43 +04:00
|
|
|
}
|
2007-10-09 01:58:22 +04:00
|
|
|
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
|
2004-02-11 03:09:59 +03:00
|
|
|
// width: integer, percent
|
2011-03-18 06:14:31 +03:00
|
|
|
nsCSSValue* width = aData->ValueForWidth();
|
|
|
|
if (width->GetUnit() == eCSSUnit_Null) {
|
2006-12-26 20:47:52 +03:00
|
|
|
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
|
2004-04-13 20:45:59 +04:00
|
|
|
if (value && value->Type() == nsAttrValue::eInteger) {
|
2011-03-18 06:14:31 +03:00
|
|
|
width->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
|
2004-04-13 20:45:59 +04:00
|
|
|
} else if (value && value->Type() == nsAttrValue::ePercent) {
|
2011-03-18 06:14:31 +03:00
|
|
|
width->SetPercentValue(value->GetPercentValue());
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
1998-08-29 03:27:19 +04:00
|
|
|
}
|
1999-03-05 07:20:07 +03:00
|
|
|
|
2011-03-18 06:14:31 +03:00
|
|
|
nsCSSValue* height = aData->ValueForHeight();
|
|
|
|
if (height->GetUnit() == eCSSUnit_Null) {
|
2004-02-11 03:09:59 +03:00
|
|
|
// size: integer
|
2003-07-30 12:13:07 +04:00
|
|
|
if (noshade) {
|
|
|
|
// noshade case: size is set using the border
|
2011-03-18 06:14:31 +03:00
|
|
|
height->SetAutoValue();
|
2003-07-30 12:13:07 +04:00
|
|
|
} else {
|
|
|
|
// normal case
|
|
|
|
// the height includes the top and bottom borders that are initially 1px.
|
|
|
|
// for size=1, html.css has a special case rule that makes this work by
|
|
|
|
// removing all but the top border.
|
2006-12-26 20:47:52 +03:00
|
|
|
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::size);
|
2004-04-13 20:45:59 +04:00
|
|
|
if (value && value->Type() == nsAttrValue::eInteger) {
|
2011-03-18 06:14:31 +03:00
|
|
|
height->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
|
2003-07-30 12:13:07 +04:00
|
|
|
} // else use default value from html.css
|
|
|
|
}
|
1999-03-05 07:20:07 +03:00
|
|
|
}
|
1998-08-29 03:27:19 +04:00
|
|
|
}
|
2007-10-09 01:58:22 +04:00
|
|
|
if ((aData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) && noshade) { // if not noshade, border styles are dealt with by html.css
|
2004-02-11 03:09:59 +03:00
|
|
|
// size: integer
|
2003-07-30 12:13:07 +04:00
|
|
|
// if a size is set, use half of it per side, otherwise, use 1px per side
|
|
|
|
float sizePerSide;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool allSides = true;
|
2006-12-26 20:47:52 +03:00
|
|
|
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::size);
|
2004-04-13 20:45:59 +04:00
|
|
|
if (value && value->Type() == nsAttrValue::eInteger) {
|
|
|
|
sizePerSide = (float)value->GetIntegerValue() / 2.0f;
|
2003-07-30 12:13:07 +04:00
|
|
|
if (sizePerSide < 1.0f) {
|
|
|
|
// XXX When the pixel bug is fixed, all the special casing for
|
|
|
|
// subpixel borders should be removed.
|
|
|
|
// In the meantime, this makes http://www.microsoft.com/ look right.
|
|
|
|
sizePerSide = 1.0f;
|
2011-10-17 18:59:28 +04:00
|
|
|
allSides = false;
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
sizePerSide = 1.0f; // default to a 2px high line
|
|
|
|
}
|
2011-03-18 06:14:31 +03:00
|
|
|
nsCSSValue* borderTopWidth = aData->ValueForBorderTopWidth();
|
|
|
|
if (borderTopWidth->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderTopWidth->SetFloatValue(sizePerSide, eCSSUnit_Pixel);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
if (allSides) {
|
2015-01-17 07:16:02 +03:00
|
|
|
nsCSSValue* borderRightWidth = aData->ValueForBorderRightWidth();
|
2011-03-18 06:14:31 +03:00
|
|
|
if (borderRightWidth->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderRightWidth->SetFloatValue(sizePerSide, eCSSUnit_Pixel);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
2011-03-18 06:14:31 +03:00
|
|
|
nsCSSValue* borderBottomWidth = aData->ValueForBorderBottomWidth();
|
|
|
|
if (borderBottomWidth->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderBottomWidth->SetFloatValue(sizePerSide, eCSSUnit_Pixel);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
2015-01-17 07:16:02 +03:00
|
|
|
nsCSSValue* borderLeftWidth = aData->ValueForBorderLeftWidth();
|
2011-03-18 06:14:31 +03:00
|
|
|
if (borderLeftWidth->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderLeftWidth->SetFloatValue(sizePerSide, eCSSUnit_Pixel);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
}
|
2001-06-01 02:19:43 +04:00
|
|
|
|
2011-03-18 06:14:31 +03:00
|
|
|
nsCSSValue* borderTopStyle = aData->ValueForBorderTopStyle();
|
|
|
|
if (borderTopStyle->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderTopStyle->SetIntValue(NS_STYLE_BORDER_STYLE_SOLID,
|
|
|
|
eCSSUnit_Enumerated);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
if (allSides) {
|
2015-01-17 07:16:02 +03:00
|
|
|
nsCSSValue* borderRightStyle = aData->ValueForBorderRightStyle();
|
2011-03-18 06:14:31 +03:00
|
|
|
if (borderRightStyle->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderRightStyle->SetIntValue(NS_STYLE_BORDER_STYLE_SOLID,
|
|
|
|
eCSSUnit_Enumerated);
|
|
|
|
}
|
|
|
|
nsCSSValue* borderBottomStyle = aData->ValueForBorderBottomStyle();
|
|
|
|
if (borderBottomStyle->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderBottomStyle->SetIntValue(NS_STYLE_BORDER_STYLE_SOLID,
|
2007-02-01 05:45:55 +03:00
|
|
|
eCSSUnit_Enumerated);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
2015-01-17 07:16:02 +03:00
|
|
|
nsCSSValue* borderLeftStyle = aData->ValueForBorderLeftStyle();
|
2011-03-18 06:14:31 +03:00
|
|
|
if (borderLeftStyle->GetUnit() == eCSSUnit_Null) {
|
|
|
|
borderLeftStyle->SetIntValue(NS_STYLE_BORDER_STYLE_SOLID,
|
|
|
|
eCSSUnit_Enumerated);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// If it would be noticeable, set the border radius to
|
2010-10-07 08:25:44 +04:00
|
|
|
// 10000px on all corners; this triggers the clamping to make
|
|
|
|
// circular ends. This assumes the <hr> isn't larger than
|
|
|
|
// that in *both* dimensions.
|
2011-03-18 06:14:31 +03:00
|
|
|
for (const nsCSSProperty* props =
|
|
|
|
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_radius);
|
|
|
|
*props != eCSSProperty_UNKNOWN; ++props) {
|
|
|
|
nsCSSValue* dimen = aData->ValueFor(*props);
|
|
|
|
if (dimen->GetUnit() == eCSSUnit_Null) {
|
|
|
|
dimen->SetFloatValue(10000.0f, eCSSUnit_Pixel);
|
2008-10-01 09:50:52 +04:00
|
|
|
}
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
}
|
2003-07-12 01:16:12 +04:00
|
|
|
}
|
2007-10-09 01:58:22 +04:00
|
|
|
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Color)) {
|
2003-07-30 12:13:07 +04:00
|
|
|
// color: a color
|
|
|
|
// (we got the color attribute earlier)
|
2011-03-18 06:14:31 +03:00
|
|
|
nsCSSValue* colorValue = aData->ValueForColor();
|
2003-07-30 12:13:07 +04:00
|
|
|
if (colorIsSet &&
|
2011-03-18 06:14:31 +03:00
|
|
|
colorValue->GetUnit() == eCSSUnit_Null &&
|
2007-11-16 06:46:42 +03:00
|
|
|
aData->mPresContext->UseDocumentColors()) {
|
2011-03-18 06:14:31 +03:00
|
|
|
colorValue->SetColorValue(color);
|
2003-07-30 12:13:07 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
|
2003-07-12 01:16:12 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP_(bool)
|
2013-02-07 18:57:13 +04:00
|
|
|
HTMLHRElement::IsAttributeMapped(const nsIAtom* aAttribute) const
|
2003-07-12 01:16:12 +04:00
|
|
|
{
|
2004-02-26 00:04:50 +03:00
|
|
|
static const MappedAttributeEntry attributes[] = {
|
2006-12-26 20:47:52 +03:00
|
|
|
{ &nsGkAtoms::align },
|
|
|
|
{ &nsGkAtoms::width },
|
|
|
|
{ &nsGkAtoms::size },
|
|
|
|
{ &nsGkAtoms::color },
|
|
|
|
{ &nsGkAtoms::noshade },
|
2012-07-30 18:20:58 +04:00
|
|
|
{ nullptr },
|
2003-04-17 00:54:20 +04:00
|
|
|
};
|
|
|
|
|
2004-02-26 00:04:50 +03:00
|
|
|
static const MappedAttributeEntry* const map[] = {
|
2003-04-17 00:54:20 +04:00
|
|
|
attributes,
|
|
|
|
sCommonAttributeMap,
|
|
|
|
};
|
|
|
|
|
2011-12-18 14:09:27 +04:00
|
|
|
return FindAttributeDependence(aAttribute, map);
|
1999-07-07 05:24:40 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-12 22:45:38 +03:00
|
|
|
nsMapRuleToAttributesFunc
|
2013-02-07 18:57:13 +04:00
|
|
|
HTMLHRElement::GetAttributeMappingFunction() const
|
1998-09-05 08:00:06 +04:00
|
|
|
{
|
2005-01-12 22:45:38 +03:00
|
|
|
return &MapAttributesIntoRule;
|
1998-08-29 03:27:19 +04:00
|
|
|
}
|
2013-02-07 18:57:13 +04:00
|
|
|
|
2013-02-07 18:57:59 +04:00
|
|
|
JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
HTMLHRElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-02-07 18:57:59 +04:00
|
|
|
{
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
return HTMLHRElementBinding::Wrap(aCx, this, aGivenProto);
|
2013-02-07 18:57:59 +04:00
|
|
|
}
|
|
|
|
|
2013-02-07 18:57:13 +04:00
|
|
|
} // namespace dom
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|