Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dislike margins and DOM tree are messed up #776

Closed
lunaisnotaboy opened this issue Oct 11, 2022 · 4 comments · Fixed by #793
Closed

Dislike margins and DOM tree are messed up #776

lunaisnotaboy opened this issue Oct 11, 2022 · 4 comments · Fixed by #793
Labels
bug Something isn't working

Comments

@lunaisnotaboy
Copy link

lunaisnotaboy commented Oct 11, 2022

Browser

Google Chrome

Browser Version

Version 105.0.5195.127 (Official Build) (64-bit)

Extension or Userscript?

Extension

Extension/Userscript Version

v3.0.0.6

Video link where you see the problem

All of them.

What happened?

The dislike text is displaying like this (missing the margin-right: 6px style):

image

Instead of this:

image

The text is also in the wrong position in the DOM; it should be something like:

<button
  class="yt-spec-button-shape-next yt-spec-button-shape-next--tonal yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button yt-spec-button-shape-next--segmented-end"
  aria-pressed="false"
  aria-label="Dislike this video"
  style="width: auto"
>
  <!-- the styles of this div should be `margin-left: -6px; margin-right: 6px;` like the like button is -->
  <div class="yt-spec-button-shape-next__icon" aria-hidden="true">
    <yt-icon style="width: 24px; height: 24px"
      ><svg
        viewBox="0 0 24 24"
        preserveAspectRatio="xMidYMid meet"
        focusable="false"
        class="style-scope yt-icon"
        style="pointer-events: none; display: block; width: 100%; height: 100%"
      >
        <g class="style-scope yt-icon">
          <path
            d="M17,4h-1H6.57C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21 c0.58,0,1.14-0.24,1.52-0.65L17,14h4V4H17z M10.4,19.67C10.21,19.88,9.92,20,9.62,20c-0.26,0-0.5-0.11-0.63-0.3 c-0.07-0.1-0.15-0.26-0.09-0.47l1.52-4.94l0.4-1.29H9.46H5.23c-0.41,0-0.8-0.17-1.03-0.46c-0.12-0.15-0.25-0.4-0.18-0.72l1.34-6 C5.46,5.35,5.97,5,6.57,5H16v8.61L10.4,19.67z M20,13h-3V5h3V13z"
            class="style-scope yt-icon"
          ></path>
        </g></svg
      ><!--css-build:shady--></yt-icon
    >
  </div>
  <div class="cbox yt-spec-button-shape-next--button-text-content">
    <span
      class="yt-core-attributed-string yt-core-attributed-string--white-space-no-wrap"
      role="text"
      >879</span
    > <!-- dislike counter goes in this span -->
  </div>
  <yt-touch-feedback-shape style="border-radius: inherit"
    ><div
      class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
      aria-hidden="true"
    >
      <div class="yt-spec-touch-feedback-shape__stroke" style=""></div>
      <div class="yt-spec-touch-feedback-shape__fill" style=""></div></div
  ></yt-touch-feedback-shape>
</button>

Instead of what it is now:

<button
  class="yt-spec-button-shape-next yt-spec-button-shape-next--tonal yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button yt-spec-button-shape-next--segmented-end"
  aria-pressed="false"
  aria-label="Dislike this video"
  style="width: auto"
>
  <div class="yt-spec-button-shape-next__icon" aria-hidden="true">
    <yt-icon style="width: 24px; height: 24px"
      ><svg
        viewBox="0 0 24 24"
        preserveAspectRatio="xMidYMid meet"
        focusable="false"
        class="style-scope yt-icon"
        style="pointer-events: none; display: block; width: 100%; height: 100%"
      >
        <g class="style-scope yt-icon">
          <path
            d="M17,4h-1H6.57C5.5,4,4.59,4.67,4.38,5.61l-1.34,6C2.77,12.85,3.82,14,5.23,14h4.23l-1.52,4.94C7.62,19.97,8.46,21,9.62,21 c0.58,0,1.14-0.24,1.52-0.65L17,14h4V4H17z M10.4,19.67C10.21,19.88,9.92,20,9.62,20c-0.26,0-0.5-0.11-0.63-0.3 c-0.07-0.1-0.15-0.26-0.09-0.47l1.52-4.94l0.4-1.29H9.46H5.23c-0.41,0-0.8-0.17-1.03-0.46c-0.12-0.15-0.25-0.4-0.18-0.72l1.34-6 C5.46,5.35,5.97,5,6.57,5H16v8.61L10.4,19.67z M20,13h-3V5h3V13z"
            class="style-scope yt-icon"
          ></path>
        </g></svg
      ><!--css-build:shady--></yt-icon
    >
  </div>
  <yt-touch-feedback-shape style="border-radius: inherit"
    ><div
      class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response"
      aria-hidden="true"
    >
      <div class="yt-spec-touch-feedback-shape__stroke" style=""></div>
      <div
        class="yt-spec-touch-feedback-shape__fill"
        style=""
      ></div></div></yt-touch-feedback-shape
  ><span id="text">795</span>
</button>

How to reproduce/recreate?

Go to any video and look at the dislike button.

Will you be available for follow-up questions to help developers diagnose & fix the issue?

Yes

@lunaisnotaboy lunaisnotaboy added the bug Something isn't working label Oct 11, 2022
@lunaisnotaboy lunaisnotaboy changed the title Fix text container Dislike margins and DOM tree are messed up Oct 11, 2022
@ErykDarnowski
Copy link
Contributor

ErykDarnowski commented Nov 15, 2022

Hey, there's also an alternative solution proposed by @Ansh4011 -> here!

@lunaisnotaboy
Copy link
Author

@ErykDarnowski while that is a temporary fix, it does not fix the issue of the DOM tree being messed up in the first place.

@ErykDarnowski
Copy link
Contributor

ErykDarnowski commented Nov 16, 2022

@lunaisnotaboy Sure! I actually haven't looked in this issue myself, just wanted to forward something which was posted in the wrong issue (the one I was working on)!

@lunaisnotaboy
Copy link
Author

Ah, okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants