Permalink
Browse files

Merge last green changeset of mozilla-inbound to mozilla-central

  • Loading branch information...
2 parents 0611bd3 + 4f702ba commit ac098024eccf11d383e1b62dc7e1036c75997d7f Ed Morley committed Dec 20, 2011
Showing with 1,445 additions and 662 deletions.
  1. +1 −3 accessible/src/html/nsHTMLTableAccessible.cpp
  2. +6 −0 accessible/tests/mochitest/table/test_table_1.html
  3. +0 −3 b2g/app/b2g.js
  4. +112 −0 b2g/chrome/content/content.css
  5. +1 −0 b2g/chrome/jar.mn
  6. +2 −0 b2g/components/B2GComponents.manifest
  7. +0 −21 build/unix/gnu-ld-scripts/jemalloc-standalone-linkage-version-script
  8. +29 −0 content/base/public/nsINode.h
  9. +37 −1 content/base/public/nsIRange.h
  10. +1 −4 content/base/src/nsGenericDOMDataNode.h
  11. +8 −0 content/base/src/nsGenericElement.cpp
  12. +1 −0 content/base/src/nsGkAtomList.h
  13. +239 −17 content/base/src/nsRange.cpp
  14. +10 −12 content/base/src/nsRange.h
  15. +9 −0 content/base/src/nsTextNode.cpp
  16. +0 −1 extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
  17. +0 −5 js/src/configure.in
  18. +2 −2 layout/base/nsDisplayList.h
  19. +18 −49 layout/generic/nsFrame.cpp
  20. +0 −1 layout/generic/nsFrame.h
  21. +1 −2 layout/generic/nsFrameSelection.h
  22. +38 −54 layout/generic/nsGfxScrollFrame.cpp
  23. +5 −8 layout/generic/nsGfxScrollFrame.h
  24. +16 −27 layout/generic/nsIFrame.h
  25. +69 −73 layout/generic/nsSelection.cpp
  26. +7 −5 layout/generic/nsTextFrame.h
  27. +26 −78 layout/generic/nsTextFrameThebes.cpp
  28. +1 −6 layout/mathml/nsMathMLmoFrame.cpp
  29. +1 −9 layout/printing/nsPrintEngine.cpp
  30. +200 −0 layout/reftests/selection/dom-mutations-ref.html
  31. +250 −0 layout/reftests/selection/dom-mutations.html
  32. +1 −0 layout/reftests/selection/reftest.list
  33. +1 −39 layout/svg/base/src/nsSVGGlyphFrame.cpp
  34. +0 −3 layout/svg/base/src/nsSVGGlyphFrame.h
  35. +2 −5 layout/tables/nsTableCellFrame.cpp
  36. +2 −3 layout/tables/nsTableFrame.cpp
  37. +0 −8 layout/tables/nsTableOuterFrame.cpp
  38. +0 −5 layout/tables/nsTableOuterFrame.h
  39. +0 −2 layout/tools/reftest/jar.mn
  40. +0 −110 layout/tools/reftest/quit.js
  41. +35 −29 layout/tools/reftest/reftest.js
  42. +0 −2 layout/tools/reftest/reftest.xul
  43. +14 −1 mobile/android/base/AutoCompletePopup.java
  44. +84 −0 mobile/android/base/AwesomeBar.java
  45. +88 −18 mobile/android/base/GeckoAppShell.java
  46. +13 −2 mobile/android/base/Makefile.in
  47. +90 −0 mobile/android/base/gfx/BitmapUtils.java
  48. +4 −0 mobile/android/base/locales/en-US/android_strings.dtd
  49. BIN mobile/android/base/resources/drawable-hdpi-v8/home_bg.png
  50. BIN mobile/android/base/resources/drawable-hdpi-v8/home_star.png
  51. +0 −7 mobile/android/base/resources/drawable/awesomebar_tab_focus.xml
  52. +0 −7 mobile/android/base/resources/drawable/awesomebar_tab_focus_selected.xml
  53. +0 −7 mobile/android/base/resources/drawable/awesomebar_tab_press.xml
  54. +0 −7 mobile/android/base/resources/drawable/awesomebar_tab_press_selected.xml
  55. +0 −7 mobile/android/base/resources/drawable/awesomebar_tab_selected.xml
  56. +0 −7 mobile/android/base/resources/drawable/awesomebar_tab_unselected.xml
  57. +1 −1 mobile/android/base/resources/layout-v11/awesomebar_search_actionbar.xml
  58. +1 −1 mobile/android/base/resources/layout/awesomebar_search.xml
  59. +2 −2 mobile/android/base/resources/layout/awesomebar_tabs.xml
  60. +13 −0 mobile/android/base/resources/menu/awesomebar_contextmenu.xml
  61. +0 −1 mobile/android/base/resources/values/colors.xml
  62. +4 −0 mobile/android/base/strings.xml.in
  63. +0 −2 mobile/xul/app/mobile.js
  64. +0 −2 widget/public/LookAndFeel.h
  65. +0 −3 widget/src/xpwidgets/nsXPLookAndFeel.cpp
@@ -106,9 +106,7 @@ nsHTMLTableCellAccessible::NativeState()
if (frame) {
state |= states::SELECTABLE;
- bool isSelected = false;
- frame->GetSelected(&isSelected);
- if (isSelected)
+ if (frame->IsSelected())
state |= states::SELECTED;
}
@@ -26,18 +26,24 @@
is(accTable.selectedCellCount, 1, "only one cell selected");
cell = getNode("col2a");
+ range = document.createRange();
range.selectNode(cell);
s.addRange(range);
cell = getNode("col2c");
+ range = document.createRange();
range.selectNode(cell);
s.addRange(range);
is(accTable.selectedColumnCount, 1, "only one column selected");
+
cell = getNode("row2a");
+ range = document.createRange();
range.selectNode(cell);
s.addRange(range);
cell = getNode("row2b");
+ range = document.createRange();
range.selectNode(cell);
s.addRange(range);
+ range = document.createRange();
cell = getNode("row2c");
range.selectNode(cell);
s.addRange(range);
View
@@ -49,9 +49,6 @@ pref("browser.homescreenURL", "file:///data/local/homescreen.html,file:///system
// Device pixel to CSS px ratio, in percent. Set to -1 to calculate based on display density.
pref("browser.viewport.scaleRatio", -1);
-/* allow scrollbars to float above chrome ui */
-pref("ui.scrollbarsCanOverlapContent", 1);
-
/* disable text selection */
pref("browser.ignoreNativeFrameTextSelection", true);
@@ -0,0 +1,112 @@
+/* ***** 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 B2G.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either 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 ***** */
+
+@namespace url("http://www.w3.org/1999/xhtml");
+@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+/* Style the scrollbars */
+xul|window xul|scrollbar {
+ display: none;
+}
+
+html xul|scrollbar {
+ display: block;
+}
+
+xul|scrollbar[orient="vertical"] {
+ -moz-appearance: none !important;
+ position: relative;
+ margin-left: -8px;
+ min-width: 8px;
+ max-width: 8px;
+ background-color: transparent !important;
+ background-image: none !important;
+ border: 0px solid transparent !important;
+}
+
+xul|scrollbar[orient="vertical"]:-moz-locale-dir(rtl) {
+ margin-left: 2px;
+ margin-right: -10px;
+}
+
+xul|scrollbar[orient="vertical"] xul|thumb {
+ max-width: 6px !important;
+ min-width: 6px !important;
+}
+
+xul|scrollbar[orient="horizontal"] {
+ -moz-appearance: none !important;
+ position: relative;
+ min-height: 8px;
+ max-height: 8px;
+ margin-top: -8px;
+ background-color: transparent !important;
+ background-image: none !important;
+ border: 0px solid transparent !important;
+}
+
+xul|scrollbar[orient="horizontal"] xul|thumb {
+ max-height: 6px !important;
+ min-height: 6px !important;
+}
+
+xul|scrollbox {
+ overflow-y: scroll;
+ overflow-x: scroll;
+}
+
+xul|scrollbarbutton {
+ min-height: 8px !important;
+ min-width: 8px !important;
+ -moz-appearance: none !important;
+ visibility: hidden;
+}
+
+xul|scrollbarbutton[sbattr="scrollbar-up-top"],
+xul|scrollbarbutton[sbattr="scrollbar-bottom-top"] {
+ display: none;
+}
+
+xul|thumb {
+ background-color: rgba(0, 0, 0, 0.4) !important;
+ -moz-border-top-colors: none !important;
+ -moz-border-bottom-colors: none !important;
+ -moz-border-right-colors: none !important;
+ -moz-border-left-colors: none !important;
+ border: 1px solid rgba(255, 255, 255, 0.4) !important;
+ -moz-border-radius: 3px;
+}
+
View
@@ -9,6 +9,7 @@ chrome.jar:
content/touch.js (content/touch.js)
content/commandUtil.js (content/commandUtil.js)
content/httpd.js (content/httpd.js)
+ content/content.css (content/content.css)
% override chrome://global/content/netError.xhtml chrome://browser/content/netError.xhtml
content/netError.xhtml (content/netError.xhtml)
@@ -0,0 +1,2 @@
+# Scrollbars
+category agent-style-sheets browser-content-stylesheet chrome://browser/content/content.css
@@ -1,21 +0,0 @@
-{
- global:
- _malloc_postfork;
- _malloc_prefork;
- jemalloc_stats;
- malloc_usable_size;
- je_malloc_usable_size_in_advance;
- posix_memalign;
- free;
- realloc;
- calloc;
- malloc;
- memalign;
- valloc;
- __free_hook;
- __malloc_hook;
- __realloc_hook;
- __memalign_hook;
- _IO_stdin_used;
- local: *;
-};
@@ -917,6 +917,18 @@ class nsINode : public nsIDOMEventTarget,
}
/**
+ * Returns true if |this| node is the common ancestor of the start/end
+ * nodes of a Range in a Selection or a descendant of such a common ancestor.
+ * This node is definitely not selected when |false| is returned, but it may
+ * or may not be selected when |true| is returned.
+ */
+ bool IsSelectionDescendant() const
+ {
+ return IsDescendantOfCommonAncestorForRangeInSelection() ||
+ IsCommonAncestorForRangeInSelection();
+ }
+
+ /**
* Get the root content of an editor. So, this node must be a descendant of
* an editor. Note that this should be only used for getting input or textarea
* editor's root content. This method doesn't support HTML editors.
@@ -1201,6 +1213,11 @@ class nsINode : public nsIDOMEventTarget,
ElementHasName,
// Set if the element might have a contenteditable attribute set.
ElementMayHaveContentEditableAttr,
+ // Set if the node is the common ancestor of the start/end nodes of a Range
+ // that is in a Selection.
+ NodeIsCommonAncestorForRangeInSelection,
+ // Set if the node is a descendant of a node with the above bit set.
+ NodeIsDescendantOfCommonAncestorForRangeInSelection,
// Guard value
BooleanFlagCount
};
@@ -1235,6 +1252,18 @@ class nsINode : public nsIDOMEventTarget,
bool HasName() const { return GetBoolFlag(ElementHasName); }
bool MayHaveContentEditableAttr() const
{ return GetBoolFlag(ElementMayHaveContentEditableAttr); }
+ bool IsCommonAncestorForRangeInSelection() const
+ { return GetBoolFlag(NodeIsCommonAncestorForRangeInSelection); }
+ void SetCommonAncestorForRangeInSelection()
+ { SetBoolFlag(NodeIsCommonAncestorForRangeInSelection); }
+ void ClearCommonAncestorForRangeInSelection()
+ { ClearBoolFlag(NodeIsCommonAncestorForRangeInSelection); }
+ bool IsDescendantOfCommonAncestorForRangeInSelection() const
+ { return GetBoolFlag(NodeIsDescendantOfCommonAncestorForRangeInSelection); }
+ void SetDescendantOfCommonAncestorForRangeInSelection()
+ { SetBoolFlag(NodeIsDescendantOfCommonAncestorForRangeInSelection); }
+ void ClearDescendantOfCommonAncestorForRangeInSelection()
+ { ClearBoolFlag(NodeIsDescendantOfCommonAncestorForRangeInSelection); }
protected:
void SetParentIsContent(bool aValue) { SetBoolFlag(ParentIsContent, aValue); }
@@ -40,8 +40,10 @@
#include "nsISupports.h"
#include "nsCOMPtr.h"
+#include "nsHashKeys.h"
#include "nsINode.h"
#include "nsIDOMRange.h"
+#include "nsTHashtable.h"
// IID for the nsIRange interface
#define NS_IRANGE_IID \
@@ -60,7 +62,8 @@ class nsIRange : public nsIDOMRange {
mEndOffset(0),
mIsPositioned(false),
mIsDetached(false),
- mMaySpanAnonymousSubtrees(false)
+ mMaySpanAnonymousSubtrees(false),
+ mInSelection(false)
{
}
@@ -110,6 +113,33 @@ class nsIRange : public nsIDOMRange {
mMaySpanAnonymousSubtrees = aMaySpanAnonymousSubtrees;
}
+ /**
+ * Return true iff this range is part of at least one Selection object
+ * and isn't detached.
+ */
+ bool IsInSelection() const
+ {
+ return mInSelection;
+ }
+
+ /**
+ * Called when the range is added/removed from a Selection.
+ */
+ void SetInSelection(bool aInSelection)
+ {
+ if (mInSelection == aInSelection || mIsDetached) {
+ return;
+ }
+ mInSelection = aInSelection;
+ nsINode* commonAncestor = GetCommonAncestor();
+ NS_ASSERTION(commonAncestor, "unexpected disconnected nodes");
+ if (mInSelection) {
+ RegisterCommonAncestor(commonAncestor);
+ } else {
+ UnregisterCommonAncestor(commonAncestor);
+ }
+ }
+
virtual nsINode* GetCommonAncestor() const = 0;
virtual void Reset() = 0;
@@ -128,7 +158,12 @@ class nsIRange : public nsIDOMRange {
// To support the font inspector API
NS_IMETHOD GetUsedFontFaces(nsIDOMFontFaceList** aResult) = 0;
+ typedef nsTHashtable<nsPtrHashKey<nsIRange> > RangeHashTable;
protected:
+ void RegisterCommonAncestor(nsINode* aNode);
+ void UnregisterCommonAncestor(nsINode* aNode);
+ nsINode* IsValidBoundary(nsINode* aNode);
+
nsCOMPtr<nsINode> mRoot;
nsCOMPtr<nsINode> mStartParent;
nsCOMPtr<nsINode> mEndParent;
@@ -138,6 +173,7 @@ class nsIRange : public nsIDOMRange {
bool mIsPositioned;
bool mIsDetached;
bool mMaySpanAnonymousSubtrees;
+ bool mInSelection;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRange, NS_IRANGE_IID)
@@ -63,11 +63,8 @@
// whitespace, we may need to reframe it (or its ancestors).
#define NS_REFRAME_IF_WHITESPACE (1 << (NODE_TYPE_SPECIFIC_BITS_OFFSET + 1))
-// This bit is set to indicate that the text may be part of a selection.
-#define NS_TEXT_IN_SELECTION (1 << (NODE_TYPE_SPECIFIC_BITS_OFFSET + 2))
-
// Make sure we have enough space for those bits
-PR_STATIC_ASSERT(NODE_TYPE_SPECIFIC_BITS_OFFSET + 2 < 32);
+PR_STATIC_ASSERT(NODE_TYPE_SPECIFIC_BITS_OFFSET + 1 < 32);
class nsIDOMAttr;
class nsIDOMEventListener;
@@ -91,6 +91,9 @@
#endif /* MOZ_XUL */
#include "nsFrameManager.h"
#include "nsFrameSelection.h"
+#ifdef DEBUG
+#include "nsIRange.h"
+#endif
#include "nsBindingManager.h"
#include "nsXBLBinding.h"
@@ -4933,6 +4936,11 @@ nsGenericElement::List(FILE* out, PRInt32 aIndent,
fprintf(out, " state=[%llx]", State().GetInternalValue());
fprintf(out, " flags=[%08x]", static_cast<unsigned int>(GetFlags()));
+ if (IsCommonAncestorForRangeInSelection()) {
+ nsIRange::RangeHashTable* ranges =
+ static_cast<nsIRange::RangeHashTable*>(GetProperty(nsGkAtoms::range));
+ fprintf(out, " ranges:%d", ranges ? ranges->Count() : 0);
+ }
fprintf(out, " primaryframe=%p", static_cast<void*>(GetPrimaryFrame()));
fprintf(out, " refcount=%d<", mRefCnt.get());
@@ -836,6 +836,7 @@ GK_ATOM(queryset, "queryset")
GK_ATOM(querytype, "querytype")
GK_ATOM(radio, "radio")
GK_ATOM(radiogroup, "radiogroup")
+GK_ATOM(range, "range")
GK_ATOM(readonly, "readonly")
GK_ATOM(rect, "rect")
GK_ATOM(rectangle, "rectangle")
Oops, something went wrong.

0 comments on commit ac09802

Please sign in to comment.