source: webkit/trunk/Source/WebCore/rendering/RenderTextControlMultiLine.h

Last change on this file was 275413, checked in by [email protected], 4 years ago

Subpixel layout: Switch inlines' baseline positioning from int to LayoutUnit.
https://bugs.webkit.org/show_bug.cgi?id=133932

Patch by Rob Buis <[email protected]> on 2021-04-02
Reviewed by Zalan Bujtas.

This change converts the int returns type to LayoutUnit.
To match the old behavior, the implicit toInt() calls
have been replaced by explicit toInt() calls.

  • rendering/GridBaselineAlignment.cpp:

(WebCore::GridBaselineAlignment::ascentForChild const):

  • rendering/InlineBox.cpp:

(WebCore::InlineBox::baselinePosition const):

  • rendering/InlineBox.h:
  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::baselinePosition const):

  • rendering/InlineTextBox.h:
  • rendering/RenderAttachment.cpp:

(WebCore::RenderAttachment::baselinePosition const):

  • rendering/RenderAttachment.h:
  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::baselinePosition const):
(WebCore::RenderBlock::firstLineBaseline const):
(WebCore::RenderBlock::inlineBlockBaseline const):

  • rendering/RenderBlock.h:
  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):

  • rendering/RenderBlockFlow.h:
  • rendering/RenderBox.cpp:

(WebCore::RenderBox::baselinePosition const):

  • rendering/RenderBox.h:

(WebCore::RenderBox::firstLineBaseline const):
(WebCore::RenderBox::inlineBlockBaseline const):

  • rendering/RenderBoxModelObject.h:
  • rendering/RenderButton.cpp:

(WebCore::RenderButton::baselinePosition const):

  • rendering/RenderButton.h:
  • rendering/RenderFlexibleBox.cpp:

(WebCore::synthesizedBaselineFromBorderBox):
(WebCore::RenderFlexibleBox::baselinePosition const):
(WebCore::RenderFlexibleBox::firstLineBaseline const):
(WebCore::RenderFlexibleBox::inlineBlockBaseline const):

  • rendering/RenderFlexibleBox.h:
  • rendering/RenderGrid.cpp:

(WebCore::synthesizedBaselineFromBorderBox):
(WebCore::RenderGrid::baselinePosition const):
(WebCore::RenderGrid::firstLineBaseline const):
(WebCore::RenderGrid::inlineBlockBaseline const):

  • rendering/RenderGrid.h:
  • rendering/RenderInline.cpp:

(WebCore::RenderInline::baselinePosition const):

  • rendering/RenderInline.h:
  • rendering/RenderLineBreak.cpp:

(WebCore::RenderLineBreak::baselinePosition const):

  • rendering/RenderLineBreak.h:
  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::baselinePosition const):

  • rendering/RenderListBox.h:
  • rendering/RenderListMarker.cpp:

(WebCore::RenderListMarker::baselinePosition const):

  • rendering/RenderListMarker.h:
  • rendering/RenderMenuList.h:
  • rendering/RenderSlider.cpp:

(WebCore::RenderSlider::baselinePosition const):

  • rendering/RenderSlider.h:
  • rendering/RenderTable.cpp:

(WebCore::RenderTable::baselinePosition const):
(WebCore::RenderTable::inlineBlockBaseline const):
(WebCore::RenderTable::firstLineBaseline const):

  • rendering/RenderTable.h:
  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::firstLineBaseline const):

  • rendering/RenderTableSection.h:
  • rendering/RenderTextControl.h:
  • rendering/RenderTextControlMultiLine.cpp:

(WebCore::RenderTextControlMultiLine::baselinePosition const):

  • rendering/RenderTextControlMultiLine.h:
  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::baselinePosition const):

  • rendering/RootInlineBox.h:
  • rendering/mathml/RenderMathMLBlock.cpp:

(WebCore::RenderMathMLBlock::baselinePosition const):
(WebCore::RenderMathMLTable::firstLineBaseline const):

  • rendering/mathml/RenderMathMLBlock.h:

(WebCore::RenderMathMLBlock::ascentForChild):

  • rendering/mathml/RenderMathMLFraction.cpp:

(WebCore::RenderMathMLFraction::firstLineBaseline const):

  • rendering/mathml/RenderMathMLFraction.h:
  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::firstLineBaseline const):

  • rendering/mathml/RenderMathMLOperator.h:
  • rendering/mathml/RenderMathMLPadded.cpp:

(WebCore::RenderMathMLPadded::firstLineBaseline const):

  • rendering/mathml/RenderMathMLPadded.h:
  • rendering/mathml/RenderMathMLRow.cpp:

(WebCore::RenderMathMLRow::firstLineBaseline const):

  • rendering/mathml/RenderMathMLRow.h:
  • rendering/mathml/RenderMathMLScripts.cpp:

(WebCore::RenderMathMLScripts::firstLineBaseline const):

  • rendering/mathml/RenderMathMLScripts.h:
  • rendering/mathml/RenderMathMLSpace.cpp:

(WebCore::RenderMathMLSpace::firstLineBaseline const):

  • rendering/mathml/RenderMathMLSpace.h:
  • rendering/mathml/RenderMathMLToken.cpp:

(WebCore::RenderMathMLToken::firstLineBaseline const):

  • rendering/mathml/RenderMathMLToken.h:
  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1/*
2 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22#pragma once
23
24#include "HTMLTextAreaElement.h"
25#include "RenderTextControl.h"
26
27namespace WebCore {
28
29class RenderTextControlMultiLine final : public RenderTextControl {
30 WTF_MAKE_ISO_ALLOCATED(RenderTextControlMultiLine);
31public:
32 RenderTextControlMultiLine(HTMLTextAreaElement&, RenderStyle&&);
33 virtual ~RenderTextControlMultiLine();
34
35 HTMLTextAreaElement& textAreaElement() const;
36
37private:
38 void willBeDestroyed() override;
39 void element() const = delete;
40
41 bool isTextArea() const override { return true; }
42
43 bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
44
45 float getAverageCharWidth() override;
46 LayoutUnit preferredContentLogicalWidth(float charWidth) const override;
47 LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const override;
48 LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
49
50 void layoutExcludedChildren(bool relayoutChildren) override;
51};
52
53inline RenderTextControlMultiLine* HTMLTextAreaElement::renderer() const
54{
55 return downcast<RenderTextControlMultiLine>(HTMLTextFormControlElement::renderer());
56}
57
58} // namespace WebCore
59
60SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTextControlMultiLine, isTextArea())
Note: See TracBrowser for help on using the repository browser.