facelessuser: This will most likely fail on Windows. Still looking for a resolution to work with the different parsers.
facelessuser: I guess it will pass, I forgot we normalize line endings in our tests to avoid issues on different platforms 🤷‍♂ . We still need to figure out what we want as the final solution though to handle the differences in the parsers in relation to carriage returns.
diff --git a/docs/src/markdown/about/changelog.md b/docs/src/markdown/about/changelog.md
index 1988f77..9cc5b1d 100644
--- a/docs/src/markdown/about/changelog.md
+++ b/docs/src/markdown/about/changelog.md
@@ -5,6 +5,10 @@
 - **NEW**: `SelectorSyntaxError` is derived from `Exception` not `SyntaxError`.
 - **NEW**: Drop support for EOL Python versions (Python 2 and Python < 3.5).
 
+## 1.9.5
+
+- **FIX**: `:placeholder-shown` should not match if the element has content that overrides the placeholder.
+
 ## 1.9.4
 
 - **FIX**: `:checked` rule was too strict with `option` elements. The specification for `:checked` does not require an
diff --git a/docs/src/markdown/selectors.md b/docs/src/markdown/selectors.md
index a59dbb0..a4d3556 100644
--- a/docs/src/markdown/selectors.md
+++ b/docs/src/markdown/selectors.md
@@ -2007,6 +2007,17 @@ Selects any `#!html <input>` or `#!html <textarea>` element that is currently di
 [<input id="0" placeholder="This is some text"/>, <textarea id="1" placeholder="This is some text"></textarea>]
 ```
 
+!!! note "Parser Differences"
+    In general, when an input has a placeholder, but the element also has valid content, the placeholder is not shown.
+    For instance, when a `textarea` has actual text associated with the element, the placeholder is overridden with the
+    actual content. A `textarea` is allowed no more than a single newline to be considered as having no content
+    (carriage returns don't count).
+
+    `html5lib` will strip out carriage returns, but `lxml` and `html.parser` will not. This will cause a difference
+    between the parsers when dealing with Windows style line endings and `textareas`. `html5lib` seems to follow
+    *closest* to what real browsers do. Soup Sieve is simply following the specification as best it can. Unfortunately,
+    it can't account for the quirks of the parsers in this case without introducing other issues.
+
 !!! tip "Additional Reading"
     https://developer.mozilla.org/en-US/docs/Web/CSS/:placeholder-shown
 
diff --git a/soupsieve/css_match.py b/soupsieve/css_match.py
index 20dc9b0..109be63 100644
--- a/soupsieve/css_match.py
+++ b/soupsieve/css_match.py
@@ -1288,6 +1288,21 @@ class _Match(object):
             self.get_prefix(el) is not None
         )
 
+    def match_placeholder_shown(self, el):
+        """
+        Match placeholder shown according to HTML spec.
+
+        - text area should be checked if they have content. A single newline does not count as content.
+
+        """
+
+        match = False
+        content = self.get_text(el)
+        if content in ('', '\n'):
+            match = True
+
+        return match
+
     def match_selectors(self, el, selectors):
         """Check if element matches one of the selectors."""
 
@@ -1320,6 +1335,9 @@ class _Match(object):
                 # Verify element is scope
                 if selector.flags & ct.SEL_SCOPE and not self.match_scope(el):
                     continue
+                # Verify element has placeholder shown
+                if selector.flags & ct.SEL_PLACEHOLDER_SHOWN and not self.match_placeholder_shown(el):
+                    continue
                 # Verify `nth` matches
                 if not self.match_nth(el, selector.nth):
                     continue
diff --git a/soupsieve/css_parser.py b/soupsieve/css_parser.py
index 0eb6443..9103a77 100644
--- a/soupsieve/css_parser.py
+++ b/soupsieve/css_parser.py
@@ -190,6 +190,7 @@ FLG_INDETERMINATE = 0x20
 FLG_OPEN = 0x40
 FLG_IN_RANGE = 0x80
 FLG_OUT_OF_RANGE = 0x100
+FLG_PLACEHOLDER_SHOWN = 0x200
 
 # Maximum cached patterns to store
 _MAXCACHE = 500
@@ -878,6 +879,7 @@ class CSSParser(object):
         is_indeterminate = bool(flags & FLG_INDETERMINATE)
         is_in_range = bool(flags & FLG_IN_RANGE)
         is_out_of_range = bool(flags & FLG_OUT_OF_RANGE)
+        is_placeholder_shown = bool(flags & FLG_PLACEHOLDER_SHOWN)
 
         if self.debug:  # pragma: no cover
             if is_pseudo:
@@ -898,6 +900,8 @@ class CSSParser(object):
                 print('    is_in_range: True')
             if is_out_of_range:
                 print('    is_out_of_range: True')
+            if is_placeholder_shown:
+                print('    is_placeholder_shown: True')
 
         if is_relative:
             selectors.append(_Selector())
@@ -1004,6 +1008,8 @@ class CSSParser(object):
             selectors[-1].flags = ct.SEL_IN_RANGE
         if is_out_of_range:
             selectors[-1].flags = ct.SEL_OUT_OF_RANGE
+        if is_placeholder_shown:
+            selectors[-1].flags = ct.SEL_PLACEHOLDER_SHOWN
 
         return ct.SelectorList([s.freeze() for s in selectors], is_not, is_html)
 
@@ -1122,22 +1128,20 @@ CSS_OPTIONAL = CSSParser(
 # CSS pattern for `:placeholder-shown`
 CSS_PLACEHOLDER_SHOWN = CSSParser(
     '''
-    html|*:is(
-        input:is(
-            :not([type]),
-            [type=""],
-            [type=text],
-            [type=search],
-            [type=url],
-            [type=tel],
-            [type=email],
-            [type=password],
-            [type=number]
-        ),
-        textarea
-    )[placeholder][placeholder!='']
+    html|input:is(
+        :not([type]),
+        [type=""],
+        [type=text],
+        [type=search],
+        [type=url],
+        [type=tel],
+        [type=email],
+        [type=password],
+        [type=number]
+    )[placeholder][placeholder!='']:is(:not([value]), [value=""]),
+    html|textarea[placeholder][placeholder!='']
     '''
-).process_selectors(flags=FLG_PSEUDO | FLG_HTML)
+).process_selectors(flags=FLG_PSEUDO | FLG_HTML | FLG_PLACEHOLDER_SHOWN)
 # CSS pattern default for `:nth-child` "of S" feature
 CSS_NTH_OF_S_DEFAULT = CSSParser(
     '*|*'
diff --git a/soupsieve/css_types.py b/soupsieve/css_types.py
index 0886f0d..629c2a9 100644
--- a/soupsieve/css_types.py
+++ b/soupsieve/css_types.py
@@ -26,6 +26,7 @@ SEL_DIR_RTL = 0x40
 SEL_IN_RANGE = 0x80
 SEL_OUT_OF_RANGE = 0x100
 SEL_DEFINED = 0x200
+SEL_PLACEHOLDER_SHOWN = 0x400
 
 
 class Immutable(object):

:placeholder-shown should not match if inputs have a value
If the input/textarea have text that overrides the placeholder, they should not match. For inputs, we need to check the value attribute and see if it is empty or not.  Textarea we must check the content of the element. Firefox seems to look to count a single newline as not being real content.
diff --git a/tests/test_level4/test_placeholder_shown.py b/tests/test_level4/test_placeholder_shown.py
index fe5bc7f..90fea7c 100644
--- a/tests/test_level4/test_placeholder_shown.py
+++ b/tests/test_level4/test_placeholder_shown.py
@@ -9,12 +9,15 @@ class TestPlaceholderShown(util.TestCase):
         """Test placeholder shown."""
 
         markup = """
+        /* These have a placeholder. */
         <input id="0" placeholder="This is some text">
         <textarea id="1" placeholder="This is some text"></textarea>
 
+        /* These do not have a placeholder. */
         <input id="2" placeholder="">
         <input id="3">
 
+        /* All types that should register has having a placeholder. */
         <input id="4" type="email" placeholder="This is some text">
         <input id="5" type="number" placeholder="This is some text">
         <input id="6" type="password" placeholder="This is some text">
@@ -25,6 +28,7 @@ class TestPlaceholderShown(util.TestCase):
         <input id="11" type="" placeholder="This is some text">
         <input id="12" type placeholder="This is some text">
 
+        /* Types that should not register has having a placeholder. */
         <input id="13" type="button" placeholder="This is some text">
         <input id="14" type="checkbox" placeholder="This is some text">
         <input id="15" type="color" placeholder="This is some text">
@@ -40,11 +44,28 @@ class TestPlaceholderShown(util.TestCase):
         <input id="25" type="submit" placeholder="This is some text">
         <input id="26" type="time" placeholder="This is some text">
         <input id="27" type="week" placeholder="This is some text">
+
+        /* Value will not override this instance as value is empty. */
+        <input id="28" type placeholder="This is some text" value="">
+
+        /* Value will override this input */
+        <input id="29" type placeholder="This is some text" value="Actual value">
+
+        /* Text area content overides the placeholder
+        <textarea id="30" placeholder="This is some text">Value</textarea>
+        <textarea id="31" placeholder="This is some text">
+
+
+        </textarea>
+
+        /* Text area is still considered empty with a single new line (does not include carriage return). */
+        <textarea id="32" placeholder="This is some text">
+        </textarea>
         """
 
         self.assert_selector(
             markup,
             ":placeholder-shown",
-            ['0', '1', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+            ['0', '1', '4', '5', '6', '7', '8', '9', '10', '11', '12', '28', '32'],
             flags=util.HTML
         )

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov coverage lxml html5lib mypy
apt-get update apt-get install -y gcc
3.9
requirements/project.txt requirements/tests.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
beautifulsoup4==4.13.3
coverage==7.8.0
exceptiongroup==1.2.2
html5lib==1.1
iniconfig==2.1.0
lxml==5.3.1
mypy==1.15.0
mypy-extensions==1.0.0
packaging==24.2
pluggy==1.5.0
pytest==8.3.5
pytest-cov==6.0.0
six==1.17.0
-e git+https://github.com/facelessuser/soupsieve.git@fc8c95078f1a8dc5d0e259dfd74fb9a59b6d3a3b#egg=soupsieve
tomli==2.2.1
typing_extensions==4.13.0
webencodings==0.5.1

name: soupsieve
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - beautifulsoup4==4.13.3
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - html5lib==1.1
      - iniconfig==2.1.0
      - lxml==5.3.1
      - mypy==1.15.0
      - mypy-extensions==1.0.0
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - six==1.17.0
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - webencodings==0.5.1
prefix: /opt/conda/envs/soupsieve

tests/test_level4/test_placeholder_shown.py::TestPlaceholderShown::test_placeholder_shown
docs/src/markdown/selectors.md docs/src/markdown/about/changelog.md soupsieve/css_types.py soupsieve/css_parser.py soupsieve/css_match.py
docs/src/markdown/selectors.md docs/src/markdown/about/changelog.md soupsieve/css_types.py soupsieve/css_parser.py soupsieve/css_match.py