Bug 1048752. Part 9: Remove nsCaret.h from nsDisplayList.h. r=tn

I got tired of slow build turnarounds every time I modified nsCaret.h.

--HG--
extra : rebase_source : 0c4598c4881ab8de0a636b08c70fb801bb912247
This commit is contained in:
Robert O'Callahan 2014-08-06 17:19:25 +12:00
parent 22a250e9db
commit 7ea822125b
11 changed files with 61 additions and 23 deletions

View File

@ -39,6 +39,7 @@
#include "nsISlowScriptDebug.h"
#include "nsWindowMemoryReporter.h"
#include "WindowNamedPropertiesHandler.h"
#include "nsFrameSelection.h"
// Helper Classes
#include "nsJSUtils.h"

View File

@ -6,6 +6,8 @@
#include "TouchCaret.h"
#include <algorithm>
#include "nsCOMPtr.h"
#include "nsFrameSelection.h"
#include "nsIFrame.h"
@ -27,7 +29,7 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsView.h"
#include "nsDOMTokenList.h"
#include <algorithm>
#include "nsCaret.h"
using namespace mozilla;

View File

@ -16,6 +16,9 @@
#include "mozilla/TouchEvents.h"
#include "Units.h"
class nsIFrame;
class nsIPresShell;
namespace mozilla {
/**

View File

@ -2724,6 +2724,30 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder,
}
}
nsDisplayCaret::nsDisplayCaret(nsDisplayListBuilder* aBuilder,
nsIFrame* aCaretFrame,
nsCaret *aCaret)
: nsDisplayItem(aBuilder, aCaretFrame)
, mCaret(aCaret)
{
MOZ_COUNT_CTOR(nsDisplayCaret);
}
#ifdef NS_BUILD_REFCNT_LOGGING
nsDisplayCaret::~nsDisplayCaret()
{
MOZ_COUNT_DTOR(nsDisplayCaret);
}
#endif
nsRect
nsDisplayCaret::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
{
*aSnap = false;
// The caret returns a rect in the coordinates of mFrame.
return mCaret->GetCaretRect() + ToReferenceFrame();
}
void
nsDisplayCaret::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) {

View File

@ -18,7 +18,6 @@
#include "nsContainerFrame.h"
#include "nsPoint.h"
#include "nsRect.h"
#include "nsCaret.h"
#include "plarena.h"
#include "nsRegion.h"
#include "FrameLayerBuilder.h"
@ -36,6 +35,7 @@ class nsRenderingContext;
class nsDisplayTableItem;
class nsISelection;
class nsDisplayLayerEventRegions;
class nsCaret;
namespace mozilla {
namespace layers {
@ -1951,21 +1951,12 @@ protected:
class nsDisplayCaret : public nsDisplayItem {
public:
nsDisplayCaret(nsDisplayListBuilder* aBuilder, nsIFrame* aCaretFrame,
nsCaret *aCaret)
: nsDisplayItem(aBuilder, aCaretFrame), mCaret(aCaret) {
MOZ_COUNT_CTOR(nsDisplayCaret);
}
nsCaret *aCaret);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplayCaret() {
MOZ_COUNT_DTOR(nsDisplayCaret);
}
virtual ~nsDisplayCaret();
#endif
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE {
*aSnap = false;
// The caret returns a rect in the coordinates of mFrame.
return mCaret->GetCaretRect() + ToReferenceFrame();
}
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE;
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE;
NS_DISPLAY_DECL_NAME("Caret", TYPE_CARET)
protected:

View File

@ -63,6 +63,7 @@
#include "DisplayItemClip.h"
#include "ActiveLayerTracker.h"
#include "CounterStyleManager.h"
#include "FrameLayerBuilder.h"
#include "AudioChannelService.h"
#include "mozilla/dom/DataStoreService.h"

View File

@ -4,12 +4,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsFormControlFrame.h"
#include "nsGkAtoms.h"
#include "nsLayoutUtils.h"
#include "nsIDOMHTMLInputElement.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/LookAndFeel.h"
#include "nsDeviceContext.h"
#include "nsIContent.h"
using namespace mozilla;

View File

@ -41,6 +41,11 @@
#include "nsIDOMNode.h"
#include "nsLayoutUtils.h"
#include "nsDisplayList.h"
#include "nsIContent.h"
#include "nsIDocument.h"
#include "FrameLayerBuilder.h"
#include "nsISelectionController.h"
#include "nsISelection.h"
#include "imgIContainer.h"
#include "imgLoader.h"
@ -804,6 +809,16 @@ nsImageFrame::GetInnerArea() const
return GetContentRect() - GetPosition();
}
Element*
nsImageFrame::GetMapElement() const
{
nsAutoString usemap;
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::usemap, usemap)) {
return mContent->OwnerDoc()->FindImageMap(usemap);
}
return nullptr;
}
// get the offset into the content area of the image where aImg starts if it is a continuation.
nscoord
nsImageFrame::GetContinuationOffset() const

View File

@ -19,6 +19,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/DebugOnly.h"
#include "nsIReflowCallback.h"
#include "nsTObserverArray.h"
class nsImageMap;
class nsIURI;
@ -150,14 +151,7 @@ public:
/**
* Return a map element associated with this image.
*/
mozilla::dom::Element* GetMapElement() const
{
nsAutoString usemap;
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::usemap, usemap)) {
return mContent->OwnerDoc()->FindImageMap(usemap);
}
return nullptr;
}
mozilla::dom::Element* GetMapElement() const;
/**
* Return true if the image has associated image map.

View File

@ -16,6 +16,8 @@
class nsTextPaintStyle;
class PropertyProvider;
struct SelectionDetails;
class nsTextFragment;
typedef nsFrame nsTextFrameBase;

View File

@ -10,12 +10,15 @@
*/
#include "BasicTableLayoutStrategy.h"
#include <algorithm>
#include "nsTableFrame.h"
#include "nsTableCellFrame.h"
#include "nsLayoutUtils.h"
#include "nsGkAtoms.h"
#include "SpanningCellSorter.h"
#include <algorithm>
#include "nsIContent.h"
using namespace mozilla;
using namespace mozilla::layout;