Skip to content

Null check m_spanElement#36

Merged
JonWBedard merged 0 commit into
WebKit:mainfrom
JonWBedard:eng/checkout-pull-request
Nov 13, 2021
Merged

Null check m_spanElement#36
JonWBedard merged 0 commit into
WebKit:mainfrom
JonWBedard:eng/checkout-pull-request

Conversation

@JonWBedard

@JonWBedard JonWBedard commented Nov 12, 2021

Copy link
Copy Markdown
Member

cbfd1c6

Null check m_spanElement
https://bugs.webkit.org/show_bug.cgi?id=230894

Patch by Rob Buis <[email protected] > on 2021-11-12
Reviewed by Wenson Hsieh.

Source/WebCore:

Null check m_spanElement in ReplaceNodeWithSpanCommand::doUnapply, since
it may not be created by ReplaceNodeWithSpanCommand::doApply.

Test: editing/execCommand/default-paragraph-separator-crash.html

* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::ReplaceNodeWithSpanCommand::doUnapply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):

LayoutTests:

* editing/execCommand/default-paragraph-separator-crash-expected.txt: Added.
* editing/execCommand/default-paragraph-separator-crash.html: Added.


Canonical link: https://commits.webkit.org/244211@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285764 268f45cc-cd09-0410-ab3c-d52691b4dbfc

@JonWBedard JonWBedard self-assigned this Nov 12, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Thank for pointing it out

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an intended logging?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, was using for debugging, removing.

@JonWBedard
JonWBedard force-pushed the eng/checkout-pull-request branch from ab7147c to 180d82d Compare November 12, 2021 18:44
@JonWBedard

Copy link
Copy Markdown
Member Author

Interesting question here: what should we do if a pull-request has been merged? Should we vend the hash of the merged commit instead of trying to use the branch the pull-request came from (which has likely been deleted)?

@sundiamonde

Copy link
Copy Markdown
Contributor

Interesting question here: what should we do if a pull-request has been merged? Should we vend the hash of the merged commit instead of trying to use the branch the pull-request came from (which has likely been deleted)?

Usually when I go to a merged pull-request I either want to commit on the patch or would rather just see the commit so I think using the commit would be better in most cases. I guess though if you are checking out a pull-request its probably for some form of testing so having it already be on a branch might be helpful.

@sundiamonde

Copy link
Copy Markdown
Contributor

If we'e adding all these remotes to a users config do we have any way to clean them up automatically?

@dewei-zhu dewei-zhu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@JonWBedard JonWBedard changed the title [git-webkit] Checkout pull-requests Null check m_spanElement Nov 13, 2021
@JonWBedard
JonWBedard merged commit cbfd1c6 into WebKit:main Nov 13, 2021
@JonWBedard

Copy link
Copy Markdown
Member Author

@JonWBedard
JonWBedard force-pushed the eng/checkout-pull-request branch from 180d82d to cbfd1c6 Compare November 13, 2021 01:17
@JonWBedard
JonWBedard deleted the eng/checkout-pull-request branch November 13, 2021 01:17
@JonWBedard

Copy link
Copy Markdown
Member Author

Huh. Something went weird when landing this, we ended up linking to cbfd1c6 instead of a8f8024

webkit-commit-queue pushed a commit that referenced this pull request Mar 15, 2026
rdar://172148530
https://bugs.webkit.org/show_bug.cgi?id=309547

Reviewed by Ryosuke Niwa and BJ Burg.

FontCascade.h was the #24 most expensive header in WebCore by total parse
time (328 inclusions × 535ms average = 175s). This patch reduces that to
328 × 366ms = 120s, a ~32% improvement, moving it to #36.

Changes to FontCascade.h:
- Remove includes of FloatSegment.h, FontCascadeFonts.h, Path.h,
  TextSpacing.h, CheckedRef.h, HashSet.h, CharacterProperties.h,
  CharacterNames.h, and RuntimeApplicationChecksCocoa.h, replacing them
  with forward declarations where needed.
- Move inline method bodies (primaryFont, fallbackRangesAt, isFixedPitch,
  canTakeFixedPitchFastContentMeasuring, fontSelector, isPlatformFont,
  metricsOfPrimaryFont, tabWidth, widthForTextUsingSimplifiedMeasuring,
  widthOfSpaceString, treatAsSpace, treatAsZeroWidthSpace,
  treatAsZeroWidthSpaceInComplexScript, normalizeSpaces,
  isCharacterWhoseGlyphsShouldBeDeletedForTextRendering,
  isInvisibleReplacementObjectCharacter) to FontCascadeInlines.h.
- Extract CodePath and CustomFontNotReadyAction enums to a new
  lightweight FontCascadeEnums.h so downstream headers can reference
  these types without pulling in all of FontCascade.h.
- Move GlyphGeometryCacheEntry out of FontCascadeFonts to namespace
  scope so it can be forward-declared in FontCascade.h.

Changes to Font.h:
- Remove includes of GlyphPage.h, Hasher.h, StringHash.h,
  OpenTypeMathData.h, and OpenTypeVerticalData.h.
- Move inline method bodies (boundsForGlyph, boundsForGlyphs,
  widthForGlyph, verticalData) to a new FontInlines.h.

~90 .cpp/.mm files are updated to add explicit includes for headers they
previously obtained transitively.

Tests: Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
       Tools/TestWebKitAPI/Tests/WebCore/MonospaceFontTests.cpp
       Tools/TestWebKitAPI/Tests/WebCore/cg/BifurcatedGraphicsContextTestsCG.cpp

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/accessibility/AXTextMarker.cpp:
* Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm:
* Source/WebCore/css/parser/SizesAttributeParser.cpp:
* Source/WebCore/dom/DocumentMarkerController.cpp:
* Source/WebCore/dom/ImageOverlay.cpp:
* Source/WebCore/editing/Editor.cpp:
* Source/WebCore/editing/TextManipulationController.cpp:
* Source/WebCore/editing/cocoa/EditingHTMLConverter.mm:
* Source/WebCore/editing/cocoa/NodeHTMLConverter.mm:
* Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:
* Source/WebCore/html/HTMLAnchorElement.cpp:
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
* Source/WebCore/html/NumberInputType.cpp:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h:
* Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp:
* Source/WebCore/inspector/InspectorOverlay.cpp:
* Source/WebCore/inspector/agents/InspectorCSSAgent.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h:
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h:
* Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp:
* Source/WebCore/layout/integration/inline/InlineIteratorBoxModernPath.h:
* Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.cpp:
* Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp:
* Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp:
* Source/WebCore/loader/cache/CachedImage.cpp:
* Source/WebCore/page/DebugPageOverlays.cpp:
* Source/WebCore/platform/graphics/ComplexTextController.cpp:
* Source/WebCore/platform/graphics/Font.cpp:
* Source/WebCore/platform/graphics/Font.h:
(WebCore::Font::ctFont const):
(WebCore::Font::verticalData const): Deleted.
(WebCore::Font::boundsForGlyph const): Deleted.
(WebCore::Font::boundsForGlyphs const): Deleted.
(WebCore::Font::widthForGlyph const): Deleted.
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleTextSlow const):
* Source/WebCore/platform/graphics/FontCascade.h:
(WebCore::FontCascade::primaryFont const): Deleted.
(WebCore::FontCascade::fallbackRangesAt const): Deleted.
(WebCore::FontCascade::isFixedPitch const): Deleted.
(WebCore::FontCascade::canTakeFixedPitchFastContentMeasuring const): Deleted.
(WebCore::FontCascade::fontSelector const): Deleted.
(WebCore::FontCascade::tabWidth const): Deleted.
(WebCore::FontCascade::widthForTextUsingSimplifiedMeasuring const): Deleted.
* Source/WebCore/platform/graphics/FontCascadeEnums.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm.
* Source/WebCore/platform/graphics/FontCascadeFonts.h:
* Source/WebCore/platform/graphics/FontCascadeInlines.h:
(WebCore::FontCascade::primaryFont const):
(WebCore::FontCascade::fallbackRangesAt const):
(WebCore::FontCascade::isFixedPitch const):
(WebCore::FontCascade::canTakeFixedPitchFastContentMeasuring const):
(WebCore::FontCascade::fontSelector const):
(WebCore::FontCascade::tabWidth const):
(WebCore::FontCascade::widthForTextUsingSimplifiedMeasuring const):
(WebCore::FontCascade::isPlatformFont const):
(WebCore::FontCascade::metricsOfPrimaryFont const):
(WebCore::FontCascade::isInvisibleReplacementObjectCharacter):
(WebCore::FontCascade::treatAsSpace):
(WebCore::FontCascade::isCharacterWhoseGlyphsShouldBeDeletedForTextRendering):
(WebCore::FontCascade::treatAsZeroWidthSpace):
(WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):
(WebCore::FontCascade::normalizeSpaces):
(WebCore::FontCascade::widthOfSpaceString const):
* Source/WebCore/platform/graphics/FontInlines.h: Added.
(WebCore::Font::verticalData const):
(WebCore::Font::boundsForGlyph const):
(WebCore::Font::boundsForGlyphs const):
(WebCore::Font::widthForGlyph const):
* Source/WebCore/platform/graphics/TextMeasurementCache.h:
* Source/WebCore/platform/graphics/WidthIterator.cpp:
* Source/WebCore/platform/graphics/ca/PlatformCALayer.mm:
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
* Source/WebCore/platform/graphics/coretext/ComplexTextControllerCoreText.mm:
* Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorder.cpp:
* Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:
* Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp:
* Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:
* Source/WebCore/platform/text/TextSpacing.cpp:
* Source/WebCore/platform/text/TextSpacing.h:
* Source/WebCore/rendering/LegacyInlineFlowBox.cpp:
* Source/WebCore/rendering/RenderBlock.cpp:
* Source/WebCore/rendering/RenderCombineText.cpp:
* Source/WebCore/rendering/RenderEmbeddedObject.cpp:
* Source/WebCore/rendering/RenderFileUploadControl.cpp:
* Source/WebCore/rendering/RenderImage.cpp:
* Source/WebCore/rendering/RenderInline.cpp:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
* Source/WebCore/rendering/RenderListBox.cpp:
* Source/WebCore/rendering/RenderReplaced.cpp:
* Source/WebCore/rendering/RenderText.cpp:
* Source/WebCore/rendering/TextBoxPainter.cpp:
* Source/WebCore/rendering/line/LineInlineHeaders.h:
* Source/WebCore/rendering/mathml/MathOperator.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLToken.cpp:
* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/rendering/svg/RenderSVGInlineText.cpp:
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
* Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:
* Source/WebCore/rendering/svg/SVGTextBoxPainter.cpp:
* Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp:
* Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp:
* Source/WebCore/style/InlineTextBoxStyle.cpp:
* Source/WebCore/style/StyleBuilderCustom.h:
* Source/WebCore/style/StyleExtractorCustom.h:
* Source/WebCore/style/StyleInterpolationFunctions.h:
* Source/WebCore/style/StyleResolver.cpp:
* Source/WebCore/style/computed/StyleComputedStyleBase.cpp:
* Source/WebCore/style/values/primitives/StyleLengthResolution.cpp:
* Source/WebKit/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
* Source/WebKitLegacy/mac/DOM/DOM.mm:
* Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm:
* Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/MonospaceFontTests.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/cg/BifurcatedGraphicsContextTestsCG.cpp:

Canonical link: https://commits.webkit.org/309288@main
Wowfunhappy referenced this pull request in Wowfunhappy/WebKit Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants