summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderTextControl.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/rendering/RenderTextControl.h
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/rendering/RenderTextControl.h')
-rw-r--r--Source/WebCore/rendering/RenderTextControl.h41
1 files changed, 32 insertions, 9 deletions
diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h
index 4de76b4dc..1f6630cee 100644
--- a/Source/WebCore/rendering/RenderTextControl.h
+++ b/Source/WebCore/rendering/RenderTextControl.h
@@ -23,6 +23,7 @@
#define RenderTextControl_h
#include "RenderBlock.h"
+#include "RenderFlexibleBox.h"
namespace WebCore {
@@ -38,7 +39,7 @@ public:
VisiblePosition visiblePositionForIndex(int index) const;
protected:
- RenderTextControl(Node*);
+ RenderTextControl(Element*);
// This convenience function should not be made public because innerTextElement may outlive the render tree.
HTMLElement* innerTextElement() const;
@@ -50,15 +51,15 @@ protected:
void hitInnerTextElement(HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
- int textBlockWidth() const;
- int textBlockHeight() const;
+ int textBlockLogicalWidth() const;
+ int textBlockLogicalHeight() const;
float scaleEmToUnits(int x) const;
static bool hasValidAvgCharWidth(AtomicString family);
virtual float getAvgCharWidth(AtomicString family);
- virtual LayoutUnit preferredContentWidth(float charWidth) const = 0;
- virtual LayoutUnit computeControlHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const = 0;
+ virtual LayoutUnit preferredContentLogicalWidth(float charWidth) const = 0;
+ virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const = 0;
virtual RenderStyle* textBaseStyle() const = 0;
virtual void updateFromElement();
@@ -68,13 +69,14 @@ protected:
private:
virtual const char* renderName() const { return "RenderTextControl"; }
virtual bool isTextControl() const { return true; }
- virtual void computePreferredLogicalWidths();
+ virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;
+ virtual void computePreferredLogicalWidths() OVERRIDE;
virtual void removeLeftoverAnonymousBlock(RenderBlock*) { }
virtual bool avoidsFloats() const { return true; }
virtual bool canHaveGeneratedChildren() const OVERRIDE { return false; }
virtual bool canBeReplacedWithInlineRunIn() const OVERRIDE;
- virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint&);
+ virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE;
virtual bool canBeProgramaticallyScrolled() const { return true; }
@@ -83,19 +85,40 @@ private:
inline RenderTextControl* toRenderTextControl(RenderObject* object)
{
- ASSERT(!object || object->isTextControl());
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isTextControl());
return static_cast<RenderTextControl*>(object);
}
inline const RenderTextControl* toRenderTextControl(const RenderObject* object)
{
- ASSERT(!object || object->isTextControl());
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isTextControl());
return static_cast<const RenderTextControl*>(object);
}
// This will catch anyone doing an unnecessary cast.
void toRenderTextControl(const RenderTextControl*);
+// Renderer for our inner container, for <search> and others.
+// We can't use RenderFlexibleBox directly, because flexboxes have a different
+// baseline definition, and then inputs of different types wouldn't line up
+// anymore.
+class RenderTextControlInnerContainer : public RenderFlexibleBox {
+public:
+ explicit RenderTextControlInnerContainer(Element* element)
+ : RenderFlexibleBox(element)
+ { }
+ virtual ~RenderTextControlInnerContainer() { }
+
+ virtual int baselinePosition(FontBaseline baseline, bool firstLine, LineDirectionMode direction, LinePositionMode position) const OVERRIDE
+ {
+ return RenderBlock::baselinePosition(baseline, firstLine, direction, position);
+ }
+ virtual int firstLineBoxBaseline() const OVERRIDE { return RenderBlock::firstLineBoxBaseline(); }
+ virtual int inlineBlockBaseline(LineDirectionMode direction) const OVERRIDE { return RenderBlock::inlineBlockBaseline(direction); }
+
+};
+
+
} // namespace WebCore
#endif // RenderTextControl_h