Diff
Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/ChangeLog 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog 2022-03-07 22:10:01 UTC (rev 290933)
@@ -1,5 +1,80 @@
2022-03-07 Russell Epstein <[email protected]>
+ Cherry-pick r290305. rdar://problem/89287719
+
+ Rename RenderStyle::userSelectIncludingInert to RenderStyle::effectiveUserSelect
+ https://bugs.webkit.org/show_bug.cgi?id=237033
+
+ Reviewed by Antti Koivisto.
+
+ This naming is consistent with other properties (effectiveDisplay/Appearance/PointerEvents/etc.).
+
+ Source/WebCore:
+
+ * dom/Node.cpp:
+ (WebCore::computeEditabilityFromComputedStyle):
+ (WebCore::Node::canStartSelection const):
+ * dom/Position.cpp:
+ (WebCore::Position::nodeIsUserSelectNone):
+ (WebCore::Position::nodeIsUserSelectAll):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::canMouseDownStartSelect):
+ (WebCore::EventHandler::selectCursor):
+ * page/Frame.cpp:
+ (WebCore::Frame::rangeForPoint):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::selectionBackgroundColor const):
+ (WebCore::RenderElement::selectionColor const):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::collectSelectionGeometriesInternal):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::effectiveUserSelect const):
+ (WebCore::RenderStyle::userSelectIncludingInert const): Deleted.
+
+ Source/WebKit:
+
+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+ (WebKit::InjectedBundleNodeHandle::isSelectableTextNode const):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::selectionPositionInformation):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-02-22 Tim Nguyen <[email protected]>
+
+ Rename RenderStyle::userSelectIncludingInert to RenderStyle::effectiveUserSelect
+ https://bugs.webkit.org/show_bug.cgi?id=237033
+
+ Reviewed by Antti Koivisto.
+
+ This naming is consistent with other properties (effectiveDisplay/Appearance/PointerEvents/etc.).
+
+ * dom/Node.cpp:
+ (WebCore::computeEditabilityFromComputedStyle):
+ (WebCore::Node::canStartSelection const):
+ * dom/Position.cpp:
+ (WebCore::Position::nodeIsUserSelectNone):
+ (WebCore::Position::nodeIsUserSelectAll):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::canMouseDownStartSelect):
+ (WebCore::EventHandler::selectCursor):
+ * page/Frame.cpp:
+ (WebCore::Frame::rangeForPoint):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::selectionBackgroundColor const):
+ (WebCore::RenderElement::selectionColor const):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::collectSelectionGeometriesInternal):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::effectiveUserSelect const):
+ (WebCore::RenderStyle::userSelectIncludingInert const): Deleted.
+
+2022-03-07 Russell Epstein <[email protected]>
+
Cherry-pick r290197. rdar://problem/88818132
Stop propagating inertness through iframes in Node::deprecatedIsInert()
Modified: branches/safari-613-branch/Source/WebCore/dom/Node.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/dom/Node.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/dom/Node.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -764,7 +764,7 @@
continue;
// Elements with user-select: all style are considered atomic
// therefore non editable.
- if (treatment == Node::UserSelectAllIsAlwaysNonEditable && style->userSelectIncludingInert() == UserSelect::All)
+ if (treatment == Node::UserSelectAllIsAlwaysNonEditable && style->effectiveUserSelect() == UserSelect::All)
return Node::Editability::ReadOnly;
switch (style->userModify()) {
case UserModify::ReadOnly:
@@ -1133,7 +1133,7 @@
// We allow selections to begin within an element that has -webkit-user-select: none set,
// but if the element is draggable then dragging should take priority over selection.
- if (style.userDrag() == UserDrag::Element && style.userSelectIncludingInert() == UserSelect::None)
+ if (style.userDrag() == UserDrag::Element && style.effectiveUserSelect() == UserSelect::None)
return false;
}
return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelection() : true;
Modified: branches/safari-613-branch/Source/WebCore/dom/Position.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/dom/Position.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/dom/Position.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -941,7 +941,7 @@
{
if (!node)
return false;
- return node->renderer() && (node->renderer()->style().userSelectIncludingInert() == UserSelect::None);
+ return node->renderer() && (node->renderer()->style().effectiveUserSelect() == UserSelect::None);
}
bool Position::nodeIsUserSelectAll(const Node* node)
@@ -948,7 +948,7 @@
{
if (!node)
return false;
- return node->renderer() && (node->renderer()->style().userSelectIncludingInert() == UserSelect::All);
+ return node->renderer() && (node->renderer()->style().effectiveUserSelect() == UserSelect::All);
}
Node* Position::rootUserSelectAllForNode(Node* node)
Modified: branches/safari-613-branch/Source/WebCore/page/EventHandler.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/page/EventHandler.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/page/EventHandler.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -723,7 +723,7 @@
return true;
if (ImageOverlay::isOverlayText(*node))
- return node->renderer()->style().userSelectIncludingInert() != UserSelect::None;
+ return node->renderer()->style().effectiveUserSelect() != UserSelect::None;
return node->canStartSelection() || Position::nodeIsUserSelectAll(node.get());
}
@@ -1525,7 +1525,7 @@
case CursorType::Auto: {
if (ImageOverlay::isOverlayText(node.get())) {
auto* renderer = node->renderer();
- if (renderer && renderer->style().userSelectIncludingInert() != UserSelect::None)
+ if (renderer && renderer->style().effectiveUserSelect() != UserSelect::None)
return iBeam;
}
Modified: branches/safari-613-branch/Source/WebCore/page/Frame.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/page/Frame.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/page/Frame.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -856,7 +856,7 @@
auto position = visiblePositionForPoint(framePoint);
auto containerText = position.deepEquivalent().containerText();
- if (!containerText || !containerText->renderer() || containerText->renderer()->style().userSelectIncludingInert() == UserSelect::None)
+ if (!containerText || !containerText->renderer() || containerText->renderer()->style().effectiveUserSelect() == UserSelect::None)
return std::nullopt;
if (auto previousCharacterRange = makeSimpleRange(position.previous(), position)) {
Modified: branches/safari-613-branch/Source/WebCore/rendering/RenderElement.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/rendering/RenderElement.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/rendering/RenderElement.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -1534,7 +1534,7 @@
{
// If the element is unselectable, or we are only painting the selection,
// don't override the foreground color with the selection foreground color.
- if (style().userSelectIncludingInert() == UserSelect::None
+ if (style().effectiveUserSelect() == UserSelect::None
|| (view().frameView().paintBehavior().containsAny({ PaintBehavior::SelectionOnly, PaintBehavior::SelectionAndBackgroundsOnly })))
return Color();
@@ -1589,7 +1589,7 @@
Color RenderElement::selectionBackgroundColor() const
{
- if (style().userSelectIncludingInert() == UserSelect::None)
+ if (style().effectiveUserSelect() == UserSelect::None)
return Color();
if (frame().selection().shouldShowBlockCursor() && frame().selection().isCaret())
Modified: branches/safari-613-branch/Source/WebCore/rendering/RenderLayer.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/rendering/RenderLayer.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/rendering/RenderLayer.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -5242,7 +5242,7 @@
if (!renderText.hasRenderedText())
continue;
- if (renderer.style().userSelectIncludingInert() != UserSelect::None)
+ if (renderer.style().effectiveUserSelect() != UserSelect::None)
request.setHasPaintedContent();
if (!renderText.text().isAllSpecialCharacters<isHTMLSpace>()) {
Modified: branches/safari-613-branch/Source/WebCore/rendering/RenderObject.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/rendering/RenderObject.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/rendering/RenderObject.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -2249,7 +2249,7 @@
for (auto& node : intersectingNodesWithDeprecatedZeroOffsetStartQuirk(range)) {
auto renderer = node.renderer();
// Only ask leaf render objects for their line box rects.
- if (renderer && !renderer->firstChildSlow() && renderer->style().userSelectIncludingInert() != UserSelect::None) {
+ if (renderer && !renderer->firstChildSlow() && renderer->style().effectiveUserSelect() != UserSelect::None) {
bool isStartNode = renderer->node() == range.start.container.ptr();
bool isEndNode = renderer->node() == range.end.container.ptr();
if (hasFlippedWritingMode != renderer->style().isFlippedBlocksWritingMode())
Modified: branches/safari-613-branch/Source/WebCore/rendering/style/RenderStyle.h (290932 => 290933)
--- branches/safari-613-branch/Source/WebCore/rendering/style/RenderStyle.h 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebCore/rendering/style/RenderStyle.h 2022-03-07 22:10:01 UTC (rev 290933)
@@ -611,7 +611,7 @@
MarqueeDirection marqueeDirection() const { return static_cast<MarqueeDirection>(m_rareNonInheritedData->marquee->direction); }
UserModify userModify() const { return static_cast<UserModify>(m_rareInheritedData->userModify); }
UserDrag userDrag() const { return static_cast<UserDrag>(m_rareNonInheritedData->userDrag); }
- UserSelect userSelectIncludingInert() const { return effectiveInert() ? UserSelect::None : userSelect(); }
+ UserSelect effectiveUserSelect() const { return effectiveInert() ? UserSelect::None : userSelect(); }
UserSelect userSelect() const { return static_cast<UserSelect>(m_rareInheritedData->userSelect); }
TextOverflow textOverflow() const { return static_cast<TextOverflow>(m_rareNonInheritedData->textOverflow); }
WordBreak wordBreak() const { return static_cast<WordBreak>(m_rareInheritedData->wordBreak); }
Modified: branches/safari-613-branch/Source/WebKit/ChangeLog (290932 => 290933)
--- branches/safari-613-branch/Source/WebKit/ChangeLog 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebKit/ChangeLog 2022-03-07 22:10:01 UTC (rev 290933)
@@ -1,5 +1,63 @@
2022-03-07 Russell Epstein <[email protected]>
+ Cherry-pick r290305. rdar://problem/89287719
+
+ Rename RenderStyle::userSelectIncludingInert to RenderStyle::effectiveUserSelect
+ https://bugs.webkit.org/show_bug.cgi?id=237033
+
+ Reviewed by Antti Koivisto.
+
+ This naming is consistent with other properties (effectiveDisplay/Appearance/PointerEvents/etc.).
+
+ Source/WebCore:
+
+ * dom/Node.cpp:
+ (WebCore::computeEditabilityFromComputedStyle):
+ (WebCore::Node::canStartSelection const):
+ * dom/Position.cpp:
+ (WebCore::Position::nodeIsUserSelectNone):
+ (WebCore::Position::nodeIsUserSelectAll):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::canMouseDownStartSelect):
+ (WebCore::EventHandler::selectCursor):
+ * page/Frame.cpp:
+ (WebCore::Frame::rangeForPoint):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::selectionBackgroundColor const):
+ (WebCore::RenderElement::selectionColor const):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::collectSelectionGeometriesInternal):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::effectiveUserSelect const):
+ (WebCore::RenderStyle::userSelectIncludingInert const): Deleted.
+
+ Source/WebKit:
+
+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+ (WebKit::InjectedBundleNodeHandle::isSelectableTextNode const):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::selectionPositionInformation):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-02-22 Tim Nguyen <[email protected]>
+
+ Rename RenderStyle::userSelectIncludingInert to RenderStyle::effectiveUserSelect
+ https://bugs.webkit.org/show_bug.cgi?id=237033
+
+ Reviewed by Antti Koivisto.
+
+ This naming is consistent with other properties (effectiveDisplay/Appearance/PointerEvents/etc.).
+
+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+ (WebKit::InjectedBundleNodeHandle::isSelectableTextNode const):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::selectionPositionInformation):
+
+2022-03-07 Russell Epstein <[email protected]>
+
Cherry-pick r290246. rdar://problem/85811396
Change IPC encoding of boolean type to use one bit
Modified: branches/safari-613-branch/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp (290932 => 290933)
--- branches/safari-613-branch/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp 2022-03-07 22:10:01 UTC (rev 290933)
@@ -398,7 +398,7 @@
return false;
auto renderer = m_node->renderer();
- return renderer && renderer->style().userSelectIncludingInert() != UserSelect::None;
+ return renderer && renderer->style().effectiveUserSelect() != UserSelect::None;
}
RefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::htmlTableCellElementCellAbove()
Modified: branches/safari-613-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (290932 => 290933)
--- branches/safari-613-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2022-03-07 22:09:56 UTC (rev 290932)
+++ branches/safari-613-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2022-03-07 22:10:01 UTC (rev 290933)
@@ -2920,7 +2920,7 @@
auto* renderer = hitNode->renderer();
info.selectability = ([&] {
- if (renderer->style().userSelectIncludingInert() == UserSelect::None)
+ if (renderer->style().effectiveUserSelect() == UserSelect::None)
return InteractionInformationAtPosition::Selectability::UnselectableDueToUserSelectNone;
if (is<Element>(*hitNode)) {
@@ -2966,7 +2966,7 @@
continue;
auto& style = renderer->style();
- if (style.userSelectIncludingInert() == UserSelect::None && style.userDrag() == UserDrag::Element) {
+ if (style.effectiveUserSelect() == UserSelect::None && style.userDrag() == UserDrag::Element) {
info.prefersDraggingOverTextSelection = true;
break;
}