Closed Bug 861805 Opened 10 years ago Closed 1 year ago

Stop layers from snapping transforms for SVG content

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1523343
mozilla23

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file, 2 obsolete files)

The layers code sometimes snaps transforms to keep things on pixel boundaries. While we want that for HTML, we don't want it for SVG.
Attached patch patch (obsolete) — Splinter Review
Attachment #737432 - Flags: review?(roc)
Comment on attachment 737432 [details] [diff] [review]
patch

Review of attachment 737432 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/Layers.h
@@ +873,5 @@
> +   * CONSTRUCTION PHASE ONLY
> +   * Used for SVG content which does not want the snapping behavior that is
> +   * desirable in HTML.
> +   */
> +  void DisableTransformSnapping();

I'd prefer to make this a CONTENT_ flag. Say CONTENT_DISABLE_TRANSFORM_SNAPPING.
Attached patch patch (obsolete) — Splinter Review
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #2)
> I'd prefer to make this a CONTENT_ flag. Say
> CONTENT_DISABLE_TRANSFORM_SNAPPING.

Sure, sounds good.
Attachment #737432 - Attachment is obsolete: true
Attachment #737432 - Flags: review?(roc)
Attachment #737444 - Flags: review?(roc)
Comment on attachment 737444 [details] [diff] [review]
patch

Review of attachment 737444 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/Layers.h
@@ +665,5 @@
>    }
> +  void AddContentFlags(uint32_t aFlags)
> +  {
> +    SetContentFlags(mContentFlags | aFlags);
> +  }

You don't need this...

::: layout/base/FrameLayerBuilder.cpp
@@ +2946,5 @@
>    containerLayer->SetUserData(&gNotifySubDocInvalidationData, nullptr);
>  
> +  if (aContainerFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
> +    containerLayer->AddContentFlags(Layer::CONTENT_DISABLE_TRANSFORM_SNAPPING);
> +  }

Just fold this into the SetContentFlags call above.
Attached patch patchSplinter Review
Attachment #737444 - Attachment is obsolete: true
Attachment #737444 - Flags: review?(roc)
Attachment #737454 - Flags: review?(roc)
https://hg.mozilla.org/mozilla-central/rev/644f16c3f87c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Depends on: 871729
Backed out as https://hg.mozilla.org/integration/mozilla-inbound/rev/854310083421 for causing bug 871729.

This change didn't appear to change/fix any reftests, but it did cause a visible regression on a real world site.

It's not clear what this change was meant to fix either. We should discuss this again once jwatt returns from PTO.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Maybe another source of pixel snapping:

http://hg.mozilla.org/mozilla-central/rev/23ee0b1ce250#l6.2
Another example of the snapping sucking is the horizontal animation in:

http://jeremie.patonnier.net/experiences/parisweb2011/animation.svg
Status: REOPENED → RESOLVED
Closed: 10 years ago1 year ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.