Skip to content

Commit

Permalink
Merge commit '22ef961b401b95256123f9c032381241f31d8e59' into embedlit…
Browse files Browse the repository at this point in the history
…e_upgrade

Conflicts:
	browser/themes/shared/devtools/toolbars.inc.css
	gfx/layers/opengl/CompositorOGL.cpp
  • Loading branch information
tmeshkova committed Jan 14, 2014
2 parents 92445a0 + 22ef961 commit 5155b5e
Show file tree
Hide file tree
Showing 3,271 changed files with 66,430 additions and 28,286 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion CLOBBER
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

Bug 932982 apparently requires a clobber or else we get B2G mochitest-2 failures.
Bug 939022 requires clobber change due to files relocation.
14 changes: 2 additions & 12 deletions accessible/src/atk/nsMaiInterfaceText.cpp
Expand Up @@ -187,18 +187,8 @@ getCharacterAtOffsetCB(AtkText* aText, gint aOffset)
if (!text || !text->IsTextRole())
return 0;

// PRUnichar is unsigned short in Mozilla
// gnuichar is guint32 in glib
PRUnichar uniChar = 0;
nsresult rv = text->GetCharacterAtOffset(aOffset, &uniChar);
if (NS_FAILED(rv))
return 0;

// Convert char to "*" when it's "password text".
if (accWrap->NativeRole() == roles::PASSWORD_TEXT)
uniChar = '*';

return static_cast<gunichar>(uniChar);
// char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib.
return static_cast<gunichar>(text->CharAt(aOffset));
}

static gchar*
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/base/DocManager.cpp
Expand Up @@ -230,7 +230,7 @@ DocManager::OnLocationChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
DocManager::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, nsresult aStatus,
const PRUnichar* aMessage)
const char16_t* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
Expand Down
13 changes: 7 additions & 6 deletions accessible/src/base/EventQueue.cpp
Expand Up @@ -226,9 +226,7 @@ EventQueue::CoalesceReorderEvents(AccEvent* aTailEvent)

// If tailEvent contains thisEvent
// then
// if show of tailEvent contains a grand parent of thisEvent
// then assert
// else if hide of tailEvent contains a grand parent of thisEvent
// if show or hide of tailEvent contains a grand parent of thisEvent
// then ignore thisEvent and its show and hide events
// otherwise ignore thisEvent but not its show and hide events
Accessible* thisParent = thisEvent->mAccessible;
Expand All @@ -237,9 +235,12 @@ EventQueue::CoalesceReorderEvents(AccEvent* aTailEvent)
AccReorderEvent* tailReorder = downcast_accEvent(aTailEvent);
uint32_t eventType = tailReorder->IsShowHideEventTarget(thisParent);

if (eventType == nsIAccessibleEvent::EVENT_SHOW) {
NS_ERROR("Accessible tree was created after it was modified! Huh?");
} else if (eventType == nsIAccessibleEvent::EVENT_HIDE) {
// Sometimes InvalidateChildren() and
// DocAccessible::CacheChildrenInSubtree() can conspire to reparent an
// accessible in this case no need for mutation events. Se bug 883708
// for details.
if (eventType == nsIAccessibleEvent::EVENT_SHOW ||
eventType == nsIAccessibleEvent::EVENT_HIDE) {
AccReorderEvent* thisReorder = downcast_accEvent(thisEvent);
thisReorder->DoNotEmitAll();
} else {
Expand Down
10 changes: 7 additions & 3 deletions accessible/src/base/nsAccessibilityService.cpp
Expand Up @@ -162,7 +162,7 @@ NS_IMPL_ISUPPORTS_INHERITED4(nsAccessibilityService,

NS_IMETHODIMP
nsAccessibilityService::Observe(nsISupports *aSubject, const char *aTopic,
const PRUnichar *aData)
const char16_t *aData)
{
if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
Shutdown();
Expand Down Expand Up @@ -1085,7 +1085,7 @@ nsAccessibilityService::Init()

observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);

static const PRUnichar kInitIndicator[] = { '1', 0 };
static const char16_t kInitIndicator[] = { '1', 0 };
observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kInitIndicator);

#ifdef A11Y_LOG
Expand Down Expand Up @@ -1123,7 +1123,7 @@ nsAccessibilityService::Shutdown()
if (observerService) {
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);

static const PRUnichar kShutdownIndicator[] = { '0', 0 };
static const char16_t kShutdownIndicator[] = { '0', 0 };
observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kShutdownIndicator);
}

Expand Down Expand Up @@ -1544,8 +1544,12 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
// Accessible HTML table cell should be a child of accessible HTML table
// or its row (CSS HTML tables are polite to the used markup at
// certain degree).
// Otherwise create a generic text accessible to avoid text jamming
// when reading by AT.
if (aContext->IsHTMLTableRow() || aContext->IsHTMLTable())
newAcc = new HTMLTableCellAccessibleWrap(aContent, document);
else
newAcc = new HyperTextAccessibleWrap(aContent, document);
break;

case eHTMLTableRowType: {
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/base/nsCoreUtils.h
Expand Up @@ -307,7 +307,7 @@ class nsCoreUtils
/**
* Returns true if the given character is whitespace symbol.
*/
static bool IsWhitespace(PRUnichar aChar)
static bool IsWhitespace(char16_t aChar)
{
return aChar == ' ' || aChar == '\n' ||
aChar == '\r' || aChar == '\t' || aChar == 0xa0;
Expand Down
8 changes: 4 additions & 4 deletions accessible/src/base/nsTextEquivUtils.cpp
Expand Up @@ -130,7 +130,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
isHTMLBlock = true;
if (!aString->IsEmpty()) {
aString->Append(PRUnichar(' '));
aString->Append(char16_t(' '));
}
}
}
Expand All @@ -146,7 +146,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
aContent->AppendTextTo(*aString);
}
if (isHTMLBlock && !aString->IsEmpty()) {
aString->Append(PRUnichar(' '));
aString->Append(char16_t(' '));
}
}

Expand Down Expand Up @@ -334,12 +334,12 @@ nsTextEquivUtils::AppendString(nsAString *aString,

// Insert spaces to insure that words from controls aren't jammed together.
if (!aString->IsEmpty() && !nsCoreUtils::IsWhitespace(aString->Last()))
aString->Append(PRUnichar(' '));
aString->Append(char16_t(' '));

aString->Append(aTextEquivalent);

if (!nsCoreUtils::IsWhitespace(aString->Last()))
aString->Append(PRUnichar(' '));
aString->Append(char16_t(' '));

return true;
}
Expand Down
7 changes: 4 additions & 3 deletions accessible/src/generic/DocAccessible.cpp
Expand Up @@ -796,7 +796,7 @@ DocAccessible::ScrollPositionDidChange(nscoord aX, nscoord aY)

NS_IMETHODIMP
DocAccessible::Observe(nsISupports* aSubject, const char* aTopic,
const PRUnichar* aData)
const char16_t* aData)
{
if (!nsCRT::strcmp(aTopic,"obs_documentCreated")) {
// State editable will now be set, readonly is now clear
Expand Down Expand Up @@ -1803,8 +1803,9 @@ DocAccessible::UpdateTree(Accessible* aContainer, nsIContent* aChildNode,
Accessible* child = aContainer->ContentChildAt(idx);

// If accessible doesn't have its own content then we assume parent
// will handle its update.
if (!child->HasOwnContent()) {
// will handle its update. If child is DocAccessible then we don't
// handle updating it here either.
if (!child->HasOwnContent() || child->IsDoc()) {
idx++;
continue;
}
Expand Down
18 changes: 11 additions & 7 deletions accessible/src/generic/HyperTextAccessible-inl.h
Expand Up @@ -128,16 +128,20 @@ HyperTextAccessible::AdjustCaretOffset(int32_t aOffset) const
// at the line should provide the line with the visual caret, otherwise
// screen readers will announce the wrong line as the user presses up or
// down arrow and land at the end of a line.
if (aOffset > 0) {
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
if (frameSelection &&
frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
return aOffset - 1;
}
}
if (aOffset > 0 && IsCaretAtEndOfLine())
return aOffset - 1;

return aOffset;
}

inline bool
HyperTextAccessible::IsCaretAtEndOfLine() const
{
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
return frameSelection &&
frameSelection->GetHint() == nsFrameSelection::HINTLEFT;
}

inline Selection*
HyperTextAccessible::DOMSelection() const
{
Expand Down
46 changes: 14 additions & 32 deletions accessible/src/generic/HyperTextAccessible.cpp
Expand Up @@ -588,11 +588,6 @@ HyperTextAccessible::TextBeforeOffset(int32_t aOffset,
int32_t* aStartOffset, int32_t* aEndOffset,
nsAString& aText)
{
if (aBoundaryType == BOUNDARY_CHAR) {
GetCharAt(aOffset, eGetBefore, aText, aStartOffset, aEndOffset);
return;
}

*aStartOffset = *aEndOffset = 0;
aText.Truncate();

Expand All @@ -608,7 +603,8 @@ HyperTextAccessible::TextBeforeOffset(int32_t aOffset,

switch (aBoundaryType) {
case BOUNDARY_CHAR:
MOZ_ASSUME_UNREACHABLE("Already handled!");
if (convertedOffset != 0)
CharAt(convertedOffset - 1, aText, aStartOffset, aEndOffset);
break;

case BOUNDARY_WORD_START: {
Expand Down Expand Up @@ -675,7 +671,12 @@ HyperTextAccessible::TextAtOffset(int32_t aOffset,

switch (aBoundaryType) {
case BOUNDARY_CHAR:
GetCharAt(aOffset, eGetAt, aText, aStartOffset, aEndOffset);
// Return no char if caret is at the end of wrapped line (case of no line
// end character). Returning a next line char is confusing for AT.
if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET && IsCaretAtEndOfLine())
*aStartOffset = *aEndOffset = adjustedOffset;
else
CharAt(adjustedOffset, aText, aStartOffset, aEndOffset);
break;

case BOUNDARY_WORD_START:
Expand Down Expand Up @@ -723,11 +724,6 @@ HyperTextAccessible::TextAfterOffset(int32_t aOffset,
int32_t* aStartOffset, int32_t* aEndOffset,
nsAString& aText)
{
if (aBoundaryType == BOUNDARY_CHAR) {
GetCharAt(aOffset, eGetAfter, aText, aStartOffset, aEndOffset);
return;
}

*aStartOffset = *aEndOffset = 0;
aText.Truncate();

Expand All @@ -743,7 +739,12 @@ HyperTextAccessible::TextAfterOffset(int32_t aOffset,

switch (aBoundaryType) {
case BOUNDARY_CHAR:
MOZ_ASSUME_UNREACHABLE("Already handled!");
// If caret is at the end of wrapped line (case of no line end character)
// then char after the offset is a first char at next line.
if (adjustedOffset >= CharacterCount())
*aStartOffset = *aEndOffset = CharacterCount();
else
CharAt(adjustedOffset + 1, aText, aStartOffset, aEndOffset);
break;

case BOUNDARY_WORD_START:
Expand Down Expand Up @@ -1656,25 +1657,6 @@ HyperTextAccessible::RenderedToContentOffset(nsIFrame* aFrame, uint32_t aRendere
////////////////////////////////////////////////////////////////////////////////
// HyperTextAccessible public

bool
HyperTextAccessible::GetCharAt(int32_t aOffset, EGetTextType aShift,
nsAString& aChar, int32_t* aStartOffset,
int32_t* aEndOffset)
{
aChar.Truncate();

int32_t offset = ConvertMagicOffset(aOffset) + static_cast<int32_t>(aShift);
if (!CharAt(offset, aChar))
return false;

if (aStartOffset)
*aStartOffset = offset;
if (aEndOffset)
*aEndOffset = aChar.IsEmpty() ? offset : offset + 1;

return true;
}

int32_t
HyperTextAccessible::GetChildOffset(uint32_t aChildIndex,
bool aInvalidateAfter)
Expand Down
51 changes: 26 additions & 25 deletions accessible/src/generic/HyperTextAccessible.h
Expand Up @@ -24,13 +24,11 @@ struct DOMPoint {
int32_t idx;
};

enum EGetTextType { eGetBefore=-1, eGetAt=0, eGetAfter=1 };

// This character marks where in the text returned via nsIAccessibleText(),
// that embedded object characters exist
const PRUnichar kEmbeddedObjectChar = 0xfffc;
const PRUnichar kImaginaryEmbeddedObjectChar = ' ';
const PRUnichar kForcedNewLineChar = '\n';
const char16_t kEmbeddedObjectChar = 0xfffc;
const char16_t kImaginaryEmbeddedObjectChar = ' ';
const char16_t kForcedNewLineChar = '\n';

/**
* Special Accessible that knows how contain both text and embedded objects
Expand Down Expand Up @@ -170,46 +168,44 @@ class HyperTextAccessible : public AccessibleWrap,
/**
* Get a character at the given offset (don't support magic offsets).
*/
bool CharAt(int32_t aOffset, nsAString& aChar)
bool CharAt(int32_t aOffset, nsAString& aChar,
int32_t* aStartOffset = nullptr, int32_t* aEndOffset = nullptr)
{
NS_ASSERTION(!aStartOffset == !aEndOffset,
"Offsets should be both defined or both undefined!");

int32_t childIdx = GetChildIndexAtOffset(aOffset);
if (childIdx == -1)
return false;

Accessible* child = GetChildAt(childIdx);
child->AppendTextTo(aChar, aOffset - GetChildOffset(childIdx), 1);

if (aStartOffset && aEndOffset) {
*aStartOffset = aOffset;
*aEndOffset = aOffset + aChar.Length();
}
return true;
}

/**
* Return true if char at the given offset equals to given char.
*/
bool IsCharAt(int32_t aOffset, char aChar)
char16_t CharAt(int32_t aOffset)
{
nsAutoString charAtOffset;
CharAt(aOffset, charAtOffset);
return charAtOffset.CharAt(0) == aChar;
return charAtOffset.CharAt(0);
}

/**
* Return true if terminal char is at the given offset.
* Return true if char at the given offset equals to given char.
*/
bool IsLineEndCharAt(int32_t aOffset)
{ return IsCharAt(aOffset, '\n'); }
bool IsCharAt(int32_t aOffset, char16_t aChar)
{ return CharAt(aOffset) == aChar; }

/**
* Get a character before/at/after the given offset.
*
* @param aOffset [in] the given offset
* @param aShift [in] specifies whether to get a char before/at/after
* offset
* @param aChar [out] the character
* @param aStartOffset [out, optional] the start offset of the character
* @param aEndOffset [out, optional] the end offset of the character
* @return false if offset at the given shift is out of range
* Return true if terminal char is at the given offset.
*/
bool GetCharAt(int32_t aOffset, EGetTextType aShift, nsAString& aChar,
int32_t* aStartOffset = nullptr, int32_t* aEndOffset = nullptr);
bool IsLineEndCharAt(int32_t aOffset)
{ return IsCharAt(aOffset, '\n'); }

/**
* Return text between given offsets.
Expand Down Expand Up @@ -401,6 +397,11 @@ class HyperTextAccessible : public AccessibleWrap,
*/
int32_t AdjustCaretOffset(int32_t aOffset) const;

/**
* Return true if caret is at end of line.
*/
bool IsCaretAtEndOfLine() const;

/**
* Return true if the given offset points to terminal empty line if any.
*/
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/html/HTMLElementAccessibles.cpp
Expand Up @@ -47,7 +47,7 @@ HTMLBRAccessible::NativeState()
ENameValueFlag
HTMLBRAccessible::NativeName(nsString& aName)
{
aName = static_cast<PRUnichar>('\n'); // Newline char
aName = static_cast<char16_t>('\n'); // Newline char
return eNameOK;
}

Expand Down

0 comments on commit 5155b5e

Please sign in to comment.