Bug 1143130 - Initialize nsIFrame::ContentOffsets members, and some additional cleanup. r=roc
authorMats Palmgren <mats@mozilla.com>
Thu, 09 Apr 2015 17:57:34 +0000
changeset 256449 cbff0d351f7466c6dc304ac7e3b5527b8524ae10
parent 256448 bfd05b76c3bb0dd47c3a892029f47463b0b8ba12
child 256450 b30ece767402b69eedc2b6a28a91022998f9a277
push id1476
push usergijskruitbosch@gmail.com
push dateFri, 10 Apr 2015 12:37:44 +0000
reviewersroc
bugs1143130
milestone40.0a1
Bug 1143130 - Initialize nsIFrame::ContentOffsets members, and some additional cleanup. r=roc
layout/generic/nsFrame.cpp
layout/generic/nsIFrame.h
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -8852,32 +8852,16 @@ nsIFrame::GetPseudoElement(nsCSSPseudoEl
     if (content->IsElement()) {
       return content->AsElement();
     }
   }
   
   return nullptr;
 }
 
-nsIFrame::ContentOffsets::ContentOffsets()
-{
-}
-
-nsIFrame::ContentOffsets::ContentOffsets(const ContentOffsets& rhs)
-  : content(rhs.content),
-    offset(rhs.offset),
-    secondaryOffset(rhs.secondaryOffset),
-    associate(rhs.associate)
-{
-}
-
-nsIFrame::ContentOffsets::~ContentOffsets()
-{
-}
-
 nsIFrame::CaretPosition::CaretPosition()
   : mContentOffset(0)
 {
 }
 
 nsIFrame::CaretPosition::~CaretPosition()
 {
 }
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -1274,28 +1274,30 @@ public:
   // a point; there is a primary and a secondary offset associated with any
   // point.  The primary and secondary offsets differ when the point is over a
   // non-text object.  The primary offset is the expected position of the
   // cursor calculated from a point; the secondary offset, when it is different,
   // indicates that the point is in the boundaries of some selectable object.
   // Note that the primary offset can be after the secondary offset; for places
   // that need the beginning and end of the object, the StartOffset and 
   // EndOffset helpers can be used.
-  struct MOZ_STACK_CLASS ContentOffsets {
-    ContentOffsets();
-    ContentOffsets(const ContentOffsets&);
-    ~ContentOffsets();
-    nsCOMPtr<nsIContent> content;
+  struct MOZ_STACK_CLASS ContentOffsets
+  {
+    ContentOffsets() : offset(0)
+                     , secondaryOffset(0)
+                     , associate(mozilla::CARET_ASSOCIATE_BEFORE) {}
     bool IsNull() { return !content; }
-    int32_t offset;
-    int32_t secondaryOffset;
     // Helpers for places that need the ends of the offsets and expect them in
     // numerical order, as opposed to wanting the primary and secondary offsets
     int32_t StartOffset() { return std::min(offset, secondaryOffset); }
     int32_t EndOffset() { return std::max(offset, secondaryOffset); }
+
+    nsCOMPtr<nsIContent> content;
+    int32_t offset;
+    int32_t secondaryOffset;
     // This value indicates whether the associated content is before or after
     // the offset; the most visible use is to allow the caret to know which line
     // to display on.
     mozilla::CaretAssociationHint associate;
   };
   enum {
     IGNORE_SELECTION_STYLE = 0x01,
     // Treat visibility:hidden frames as non-selectable