| Differences between
and this patch
- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +14 lines
Lines 7803-7808 TextRecognitionInVideosEnabled: a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml_sec1
7803
  sharedPreferenceForWebProcess: true
7803
  sharedPreferenceForWebProcess: true
7804
  mediaPlaybackRelated: true
7804
  mediaPlaybackRelated: true
7805
7805
7806
TextShapingAcrossInlineBoxes:
7807
  type: bool
7808
  status: unstable
7809
  category: css
7810
  humanReadableName: "Text Shaping Across Inline Boxes"
7811
  humanReadableDescription: "Enable Text Shaping Across Inline Boxes"
7812
  defaultValue:
7813
    WebCore:
7814
      default: false
7815
    WebKitLegacy:
7816
      default: false
7817
    WebKit:
7818
      default: false
7819
7806
TextTracksInMSEEnabled:
7820
TextTracksInMSEEnabled:
7807
  type: bool
7821
  type: bool
7808
  status: testable
7822
  status: testable
- a/Source/WebCore/layout/LayoutState.cpp +2 lines
Lines 34-39 a/Source/WebCore/layout/LayoutState.cpp_sec1
34
#include "LayoutElementBox.h"
34
#include "LayoutElementBox.h"
35
#include "LayoutInitialContainingBlock.h"
35
#include "LayoutInitialContainingBlock.h"
36
#include "RenderBox.h"
36
#include "RenderBox.h"
37
#include "Settings.h"
37
#include "TableFormattingState.h"
38
#include "TableFormattingState.h"
38
#include <wtf/TZoneMallocInlines.h>
39
#include <wtf/TZoneMallocInlines.h>
39
40
Lines 44-49 WTF_MAKE_TZONE_OR_ISO_ALLOCATED_IMPL(LayoutState); a/Source/WebCore/layout/LayoutState.cpp_sec2
44
45
45
LayoutState::LayoutState(const Document& document, const ElementBox& rootContainer, Type type, FormattingContextLayoutFunction&& formattingContextLayoutFunction, FormattingContextLogicalWidthFunction&& formattingContextLogicalWidthFunction , FormattingContextLogicalHeightFunction&& formattingContextLogicalHeightFunction)
46
LayoutState::LayoutState(const Document& document, const ElementBox& rootContainer, Type type, FormattingContextLayoutFunction&& formattingContextLayoutFunction, FormattingContextLogicalWidthFunction&& formattingContextLogicalWidthFunction , FormattingContextLogicalHeightFunction&& formattingContextLogicalHeightFunction)
46
    : m_type(type)
47
    : m_type(type)
48
    , m_isTextShapingAcrossInlineBoxesEnabled(document.settings().textShapingAcrossInlineBoxes())
47
    , m_rootContainer(rootContainer)
49
    , m_rootContainer(rootContainer)
48
    , m_securityOrigin(document.securityOrigin())
50
    , m_securityOrigin(document.securityOrigin())
49
    , m_formattingContextLayoutFunction(WTFMove(formattingContextLayoutFunction))
51
    , m_formattingContextLayoutFunction(WTFMove(formattingContextLayoutFunction))
- a/Source/WebCore/layout/LayoutState.h +2 lines
Lines 110-115 public: a/Source/WebCore/layout/LayoutState.h_sec1
110
    bool inLimitedQuirksMode() const { return m_quirksMode == QuirksMode::Limited; }
110
    bool inLimitedQuirksMode() const { return m_quirksMode == QuirksMode::Limited; }
111
    bool inStandardsMode() const { return m_quirksMode == QuirksMode::No; }
111
    bool inStandardsMode() const { return m_quirksMode == QuirksMode::No; }
112
    const SecurityOrigin& securityOrigin() const { return m_securityOrigin.get(); }
112
    const SecurityOrigin& securityOrigin() const { return m_securityOrigin.get(); }
113
    bool isTextShapingAcrossInlineBoxesEnabled() const { return m_isTextShapingAcrossInlineBoxesEnabled; }
113
114
114
    const ElementBox& root() const { return m_rootContainer; }
115
    const ElementBox& root() const { return m_rootContainer; }
115
116
Lines 133-138 private: a/Source/WebCore/layout/LayoutState.h_sec2
133
#endif
134
#endif
134
    HashMap<const Box*, std::unique_ptr<BoxGeometry>> m_layoutBoxToBoxGeometry;
135
    HashMap<const Box*, std::unique_ptr<BoxGeometry>> m_layoutBoxToBoxGeometry;
135
    QuirksMode m_quirksMode { QuirksMode::No };
136
    QuirksMode m_quirksMode { QuirksMode::No };
137
    bool m_isTextShapingAcrossInlineBoxesEnabled { false };
136
138
137
    const CheckedRef<const ElementBox> m_rootContainer;
139
    const CheckedRef<const ElementBox> m_rootContainer;
138
    const Ref<SecurityOrigin> m_securityOrigin;
140
    const Ref<SecurityOrigin> m_securityOrigin;
- a/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp +2 lines
Lines 522-527 void InlineFormattingContext::initializeInlineLayoutState(const LayoutState& glo a/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp_sec1
522
    inlineLayoutState.setShouldNotSynthesizeInlineBlockBaseline();
522
    inlineLayoutState.setShouldNotSynthesizeInlineBlockBaseline();
523
    if (globalLayoutState.inStandardsMode())
523
    if (globalLayoutState.inStandardsMode())
524
        inlineLayoutState.setInStandardsMode();
524
        inlineLayoutState.setInStandardsMode();
525
    if (globalLayoutState.isTextShapingAcrossInlineBoxesEnabled())
526
        inlineLayoutState.setShouldShapeTextAcrossInlineBoxes();
525
}
527
}
526
528
527
#if ASSERT_ENABLED
529
#if ASSERT_ENABLED
- a/Source/WebCore/layout/formattingContexts/inline/InlineLayoutState.h +4 lines
Lines 64-69 public: a/Source/WebCore/layout/formattingContexts/inline/InlineLayoutState.h_sec1
64
    void setInStandardsMode() { m_inStandardsMode = true; }
64
    void setInStandardsMode() { m_inStandardsMode = true; }
65
    bool inStandardsMode() const { return m_inStandardsMode; }
65
    bool inStandardsMode() const { return m_inStandardsMode; }
66
66
67
    void setShouldShapeTextAcrossInlineBoxes() { m_shouldShapeTextAcrossInlineBoxes = true; }
68
    bool shouldShapeTextAcrossInlineBoxes() const { return m_shouldShapeTextAcrossInlineBoxes; }
69
67
    // Integration codepath
70
    // Integration codepath
68
    void setNestedListMarkerOffsets(HashMap<const ElementBox*, LayoutUnit>&& nestedListMarkerOffsets) { m_nestedListMarkerOffsets = WTFMove(nestedListMarkerOffsets); }
71
    void setNestedListMarkerOffsets(HashMap<const ElementBox*, LayoutUnit>&& nestedListMarkerOffsets) { m_nestedListMarkerOffsets = WTFMove(nestedListMarkerOffsets); }
69
    LayoutUnit nestedListMarkerOffset(const ElementBox& listMarkerBox) const { return m_nestedListMarkerOffsets.get(&listMarkerBox); }
72
    LayoutUnit nestedListMarkerOffset(const ElementBox& listMarkerBox) const { return m_nestedListMarkerOffsets.get(&listMarkerBox); }
Lines 83-88 private: a/Source/WebCore/layout/formattingContexts/inline/InlineLayoutState.h_sec2
83
    AvailableLineWidthOverride m_availableLineWidthOverride;
86
    AvailableLineWidthOverride m_availableLineWidthOverride;
84
    bool m_shouldNotSynthesizeInlineBlockBaseline { false };
87
    bool m_shouldNotSynthesizeInlineBlockBaseline { false };
85
    bool m_inStandardsMode { false };
88
    bool m_inStandardsMode { false };
89
    bool m_shouldShapeTextAcrossInlineBoxes { false };
86
};
90
};
87
91
88
inline InlineLayoutState::InlineLayoutState(BlockLayoutState& parentBlockLayoutState)
92
inline InlineLayoutState::InlineLayoutState(BlockLayoutState& parentBlockLayoutState)
- a/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp +6 lines
Lines 834-839 Vector<std::pair<size_t, size_t>> LineBuilder::collectShapingRanges(const LineCa a/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp_sec1
834
834
835
void LineBuilder::applyShapingIfNeeded(LineCandidate& lineCandidate)
835
void LineBuilder::applyShapingIfNeeded(LineCandidate& lineCandidate)
836
{
836
{
837
    if (!layoutState().shouldShapeTextAcrossInlineBoxes())
838
        return;
839
837
    if (!lineCandidate.inlineContent.isShapingCandidateByContent())
840
    if (!lineCandidate.inlineContent.isShapingCandidateByContent())
838
        return;
841
        return;
839
842
Lines 1407-1412 void LineBuilder::commitCandidateContent(const LineCandidate& lineCandidate, std a/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp_sec2
1407
1410
1408
        if (auto* inlineTextItem = dynamicDowncast<InlineTextItem>(inlineItem)) {
1411
        if (auto* inlineTextItem = dynamicDowncast<InlineTextItem>(inlineItem)) {
1409
            auto shapingBoundary = [&]() -> std::optional<Line::ShapingBoundary> {
1412
            auto shapingBoundary = [&]() -> std::optional<Line::ShapingBoundary> {
1413
                if (!layoutState().shouldShapeTextAcrossInlineBoxes())
1414
                    return { };
1415
1410
                // Special case trailing partial run as shaping end.
1416
                // Special case trailing partial run as shaping end.
1411
                if (shapingBoundaryStart && partialTrailingContent && partialTrailingContent->trailingRunIndex == index)
1417
                if (shapingBoundaryStart && partialTrailingContent && partialTrailingContent->trailingRunIndex == index)
1412
                    return { Line::ShapingBoundary::End };
1418
                    return { Line::ShapingBoundary::End };

Return to Bug 298895